23 #ifndef  M2MB_HEAP_API_H    24 #define  M2MB_HEAP_API_H    31 #ifdef M2MB_HEAP_DEBUG    32 #define MALLOC(len)                             m2mb_heap_malloc(len, __FILE__, __LINE__)    33 #define CALLOC(nitems, size)    m2mb_heap_calloc( nitems, size, __FILE__, __LINE__)    34 #define REALLOC(ptr,len)                m2mb_heap_realloc(ptr, len, __FILE__, __LINE__)    35 #define FREE(ptr)                               m2mb_heap_free(ptr, __FILE__, __LINE__)    37 #define MALLOC(len)                     m2mb_os_malloc(len)    38 #define CALLOC(nitems, size)    m2mb_os_calloc( nitems, size)    39 #define FREE(ptr)                               m2mb_os_free(ptr)    40 #define REALLOC(ptr,len)                m2mb_os_realloc(ptr,len) 
VOID m2mb_heap_resetTrace(VOID)
m2mb_heap_resetTrace resets the current node in the list as the trace node. 
struct M2MB_ALLOC_NODE_DATA M2MB_HEAP_ALLOC_NODE_DATA_T
Structure for node data. 
void * m2mb_heap_malloc(UINT32 reqBytes, char *file, int line)
m2mb_heap_malloc allocates the memory for requested bytes(size) along with 20 bytes for M2MB_HEAP_ALL...
UINT32 m2mb_heap_getSize(UINT8 *ptr)
m2mb_heap_getSize returns the size of current node data in bytes. 
void m2mb_heap_free(void *ptr, char *file, int line)
m2mb_heap_free is called to frees the memory pointed by ptr. 
VOID m2mb_heap_log_init(VOID)
m2mb_heap_log_init is called to initialize the heap allocation list. 
void * m2mb_heap_realloc(void *ptr, UINT32 reqBytes, char *file, int line)
m2mb_heap_realloc is called to reallocate the memory of size reqBytes pointed by pointer ptr...
INT32 m2mb_heap_stat(UINT32 *total_bytes, UINT32 *free_bytes)
m2mb_heap_stat is called to get the status. 
M2MB_HEAP_ALLOC_NODE_DATA_T * m2mb_heap_getList(VOID)
m2mb_heap_getList is called to get the pointer to the current node in the M2MB_HEAP_LOG_LIST_T.