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 REALLOC(ptr,len) m2mb_heap_realloc(ptr, len, __FILE__, __LINE__) 34 #define FREE(ptr) m2mb_heap_free(ptr, __FILE__, __LINE__) 36 #define MALLOC(len) malloc(len) 37 #define FREE(ptr) free(ptr) 38 #define REALLOC(ptr,len) realloc(ptr,len)
VOID m2mb_heap_resetTrace()
m2mb_heap_resetTrace resets the current node in the list as the trace node.
VOID m2mb_heap_log_init()
m2mb_heap_log_init is called to initialize the heap allocation list.
UINT32 m2mb_heap_getSize(UINT8 *ptr)
m2mb_heap_getSize returns the size of current node data in bytes.
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...
void m2mb_heap_free(void *ptr, char *file, int line)
m2mb_heap_free is called to frees the memory pointed by ptr.
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.
INT32 m2mb_heap_stat(UINT32 *total_bytes, UINT32 *free_bytes)
m2mb_heap_stat is called to get the status.
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...
struct M2MB_ALLOC_NODE_DATA M2MB_HEAP_ALLOC_NODE_DATA_T
Structure for node data.