|
memory_arena
|
Arena statistics and diagnostics module. More...
Include dependency graph for arena_stats.c:Go to the source code of this file.
Functions | |
| t_arena_stats | arena_get_stats (const t_arena *arena) |
| Return a snapshot of the arena's internal statistics. | |
| void | arena_print_stats (t_arena *arena, FILE *stream) |
| Print formatted diagnostics about the arena to a stream. | |
| void | arena_stats_record_growth (t_arena_stats *stats, size_t size) |
Append a new growth event to the growth_history array. | |
Arena statistics and diagnostics module.
This module provides tools for inspecting, printing, recording, and retrieving memory usage statistics from a memory arena (t_arena). These features are useful for profiling, debugging, and tracking memory behavior in applications that use arenas for allocation.
The statistics include:
Core functions:
arena_print_stats(): Dump readable statistics to a FILE* stream.arena_stats_record_growth(): Track size increases during growth.arena_get_stats(): Return a snapshot copy of all statistics.arena_stats_reset(): Clear all statistics to start fresh (defined elsewhere).All functions are safe to use in multi-threaded environments when thread safety is enabled in the arena.
Definition in file arena_stats.c.