Loading...
Searching...
No Matches
Heap Memory Usage Monitor internals

internals for monitoring heap memory usage (calls to malloc/calloc/realloc/free) More...

Detailed Description

internals for monitoring heap memory usage (calls to malloc/calloc/realloc/free)

Author
Mikolai Gütschow mikol.nosp@m.ai.g.nosp@m.uetsc.nosp@m.how@.nosp@m.tu-dr.nosp@m.esde.nosp@m.n.de

Functions

void malloc_monitor_add (void *ptr, size_t size, uinttxtptr_t pc, char *func_prefix)
 Record malloc/calloc/realloc call increasing heap usage.
 
void malloc_monitor_rm (void *ptr, uinttxtptr_t pc)
 Record free/realloc call decreasing heap usage.
 
void malloc_monitor_mv (void *ptr_old, void *ptr_new, size_t size_new, uinttxtptr_t pc)
 Record realloc call either increasing or decreasing heap usage.
 

Function Documentation

◆ malloc_monitor_add()

void malloc_monitor_add ( void *  ptr,
size_t  size,
uinttxtptr_t  pc,
char *  func_prefix 
)

Record malloc/calloc/realloc call increasing heap usage.

Parameters
[in]ptrpointer to newly allocated memory
[in]sizesize of newly allocated memory
[in]pcPC of calling function
[in]func_prefixprefix identifying memory function, one of "m","c","re"

◆ malloc_monitor_mv()

void malloc_monitor_mv ( void *  ptr_old,
void *  ptr_new,
size_t  size_new,
uinttxtptr_t  pc 
)

Record realloc call either increasing or decreasing heap usage.

Parameters
[in]ptr_oldpointer to previously allocated memory
[in]ptr_newpointer to newly allocated memory
[in]size_newsize of newly allocated memory
[in]pcPC of calling function

◆ malloc_monitor_rm()

void malloc_monitor_rm ( void *  ptr,
uinttxtptr_t  pc 
)

Record free/realloc call decreasing heap usage.

Parameters
[in]ptrpointer to memory that is being freed
[in]pcPC of calling function