⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mem.h

📁 介绍ROCK OS操作系统.一般用于汽车电子,类似OCVX.里面是个DEMO文档,内附说明.
💻 H
字号:
/******************************************************************************
    Copyright (c) 2006 by RockOS.
    All rights reserved.

    This software is supported by the Rock Software Workroom only.

    Any bugs please contact the author with e-mail or QQ:
     E-mail : baobaoba520@yahoo.com.cn
         QQ : 59681888
*******************************************************************************
File name   : mem.h
Description : header file for memory management in RockOS.
            : 
            : 
Auther      : sunxinqiu
History     :
  2006-3-15   first release.
******************************************************************************/
#ifndef __MEM_H__
#define __MEM_H__

#ifdef __cplusplus
extern "C" {
#endif

enum
{
    MEM_BLK_INVALID = 0,
    MEM_BLK_FREE    = 1,
    MEM_BLK_BUSY    = 2
};

typedef struct
{
    /* the block state, may be invalid, free, or busy. */
    U16 state;

    /* memory block name for Rock Shell. */
    char name[MAX_NAME_LEN+1];

    /* memory block allocated size. */
    U32 reqSize;
    U32 localSize;

    /* the owner for memory block. */
    HTASK owner;

    /* start address for this memory block. */
    U8 * start_addr;
}MEMCB;

extern MEMCB g_memCb[];
extern U8 * g_memStartAddr;
extern U8 * g_memEndAddr;
extern int g_validMemBlkNum;
extern int g_usedMemBlkNum;

STATUS mem_init(void);
void * memAlloc(U32 size, HTASK owner, const char * name);
STATUS memFree(void * p);

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -