void sysInit()
{
...
MEM_Init(0x6050000, 0x10000); /* 6050000H番地から10000Hバイト分を
メモリ管理領域に設定 */
...
}
...
void userFunc()
{
Uint32 *mem_area1;
Uint8 *mem_area2;
...
mem_area1 = (Uint32 *)MEM_Malloc(4); /* 4バイトの領域を確保 */
if(mem_area1 == NULL){
return(ERR);
}
mem_area2 = (Uint8 *)MEM_Malloc(1); /* 1バイトの領域を確保 */
if(mem_area2 == NULL){
return(ERR);
}
...
...
MEM_Free(mem_area1); /* mem_area1のメモリを解放 */
...
}
★PROGRAMMER'S GUIDE
★メモリ管理ライブラリ