void sysInit() { ... MEM_Init(0x6050000, 0x10000); /* Set 10000H bytes from address 6050000H to memory management area */ ... } ... void userFunc() { Uint32 *mem_area1; Uint8 *mem_area2; ... mem_area1 = (Uint32 *)MEM_Malloc(4); /* Reserve 4 bytes of area */ if(mem_area1 == NULL){ return(ERR); } mem_area2 = (Uint8 *)MEM_Malloc(1); /* Reserve 1 byte area */ if(mem_area2 == NULL){ return(ERR); } ... ... MEM_Free(mem_area1); /* Free memory of mem_area1 */ ... }