30 printf(
"cleaning up allocated memory space @{%s:%d} [%lu Byte(s)] - %p\n",
48 if (new_mem == NULL) {
49 printf(
"Memory allocation for tracker failed\n");
51 new_mem->
nmemb = nmemb;
58 if (new_mem->
mem == NULL) {
59 printf(
"Memory allocation failed\n");
68 return (new_mem->
mem);
84 for (mem_list = memer.
mem_record; mem_list != NULL; prev_addr = mem_list, mem_list = mem_list->
next) {
85 if (mem_addr == mem_list->
mem) {
112 printf(
"allocations = %4d , freed allocations = %4d\n",
Top level include containg common headers.
void mem_alloc_report(void)
print report of all the assigned memory
void mem_init()
Initailize memory module
void mem_finit(void)
Close memory module by checking and destroying if any tagged memory
void untag_alloc(void *mem_addr, char *file, int line)
deallocate memory and remove from mem list (untagging)
t_gen tag_alloc(size_t nmemb, size_t size, char *file, int line)
allocate memory and store in mem list (tagging)
#define os_free(mem_addr)
#define os_alloc(nmemb, size)
Custom malloc if not defined use calloc and free.
t_mem_record * mem_record
struct memory_record * next
void * t_gen
Base Data type used for all data structure and data elements.