C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
memory_manager.c File Reference

Contains definitions of routines for managing memory allocs. More...

#include "common.h"

Go to the source code of this file.

Functions

void mem_init ()
 
Initailize memory module More...
 
void mem_finit (void)
 
Close memory module by checking and destroying if any tagged memory More...
 
t_gen tag_alloc (size_t nmemb, size_t size, char *file, int line)
 
allocate memory and store in mem list (tagging) More...
 
void untag_alloc (void *mem_addr, char *file, int line)
 
deallocate memory and remove from mem list (untagging) More...
 
void mem_alloc_report (void)
 
print report of all the assigned memory More...
 

Detailed Description

Contains definitions of routines for managing memory allocs.

Definition in file memory_manager.c.

Function Documentation

◆ mem_alloc_report()

void mem_alloc_report ( void  )


print report of all the assigned memory

Returns
- NA

Definition at line 110 of file memory_manager.c.

◆ mem_finit()

void mem_finit ( void  )


Close memory module by checking and destroying if any tagged memory

Returns
- NA

Definition at line 24 of file memory_manager.c.

◆ mem_init()

void mem_init ( void  )


Initailize memory module

Returns
- NA

Definition at line 13 of file memory_manager.c.

◆ tag_alloc()

t_gen tag_alloc ( size_t  nmemb,
size_t  size,
char *  file,
int  line 
)


allocate memory and store in mem list (tagging)

Returns
- memory address

Definition at line 44 of file memory_manager.c.

◆ untag_alloc()

void untag_alloc ( void *  mem_addr,
char *  file,
int  line 
)


deallocate memory and remove from mem list (untagging)

Returns
- memory address

Definition at line 78 of file memory_manager.c.