t_arena_stats stats
Allocation and memory usage statistics.
size_t size
Total size of the buffer.
size_t last_alloc_size
Size of the last allocation.
size_t shrinks
Number of times the arena was shrunk.
size_t peak_usage
Highest offset reached (i.e., peak memory usage)
size_t reallocations
Total number of reallocations (via arena_realloc_last)
size_t growth_history_count
Number of growth events recorded.
size_t failed_allocations
Number of failed allocation attempts.
size_t wasted_alignment_bytes
Total bytes wasted due to alignment padding.
size_t last_alloc_id
Unique ID of the last allocation.
size_t bytes_allocated
Cumulative bytes allocated.
size_t * growth_history
Array of size values recorded during arena growth.
size_t alloc_id_counter
Total allocation ID counter (used for tracking)
size_t allocations
Total number of successful allocations.
size_t live_allocations
Number of active allocations (not yet released)
size_t last_alloc_offset
Offset of the last allocation.
void arena_stats_reset(t_arena_stats *stats)
Reset the given statistics structure to zero.
void arena_print_stats(t_arena *arena, FILE *stream)
Print formatted diagnostics about the arena to a stream.
struct s_arena_stats t_arena_stats
Structure holding runtime statistics for an arena.
t_arena_stats arena_get_stats(const t_arena *arena)
Return a snapshot of the arena's internal statistics.
void arena_stats_record_growth(t_arena_stats *stats, size_t size)
Append a new growth event to the growth_history array.
Structure holding runtime statistics for an arena.
The main memory arena structure used for fast allocation.