|
memory_arena
|
Allocation hook management for tracking and debugging arena memory usage. More...
#include "arena.h"
Include dependency graph for arena_hooks.c:Go to the source code of this file.
Functions | |
| void | arena_set_allocation_hook (t_arena *arena, arena_allocation_hook cb, void *context) |
| Set or remove an allocation hook on a given arena. | |
Allocation hook management for tracking and debugging arena memory usage.
This module provides support for installing user-defined callback functions (hooks) that are triggered on every allocation performed within an arena.
Hooks can be used to:
Hooks are invoked only on successful allocations from:
arena_allocarena_callocarena_realloc_lastArena allocation hooks allow you to observe memory behavior without altering your allocation logic. You can:
How to use:
arena_allocation_hook: You can also unset the hook by passing NULL to disable tracking.
NULL), no callbacks are triggered. Hooks can be updated or cleared at any time via arena_set_allocation_hook(), if cb is NULL, the current hook will be removed and no further allocation events will be displayed.Definition in file arena_hooks.c.