...
lib_mem.h/lib_mem.c
Prototype
Code Block | ||
---|---|---|
| ||
void *Mem_HeapAlloc (CPU_SIZE_T size,
CPU_SIZE_T align,
CPU_SIZE_T *poctets_reqd,
LIB_ERR *perr); |
Arguments
size
Size of requested memory block (in octets).
...
Notes / Warnings
None.
Example Usage
Code Block | ||
---|---|---|
| ||
void *pmem_blk;
CPU_SIZE_T octets_reqd;
LIB_ERR err;
pmem_blk = Mem_HeapAlloc((CPU_SIZE_T) 100u,
(CPU_SIZE_T) 4u,
(CPU_SIZE_T)&octets_reqd,
(LIB_ERR *)&err);
if (err != LIB_ERR_NONE) {
printf("COULD NOT GET MEMORY BLOCK FROM HEAP.");
} |