memory_arena
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
arena_stats.h File Reference

Runtime statistics tracking and diagnostics for memory arenas. More...

#include <stddef.h>
#include <stdio.h>
+ Include dependency graph for arena_stats.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  s_arena_stats
 Structure holding runtime statistics for an arena. More...
 

Typedefs

typedef struct s_arena t_arena
 
typedef struct s_arena_stats t_arena_stats
 Structure holding runtime statistics for an arena.
 

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.
 
void arena_stats_reset (t_arena_stats *stats)
 Reset the given statistics structure to zero.
 

Detailed Description

Runtime statistics tracking and diagnostics for memory arenas.

Author
Toonsa
Date
2025

This module defines the t_arena_stats structure and a set of utility functions to introspect and manage arena memory usage. It enables users to track allocation metrics, debug issues, and monitor arena behavior over time.

Features include:

Use this module to:

Note
These statistics are gathered automatically by the allocator. Manual updates are rarely needed.

Definition in file arena_stats.h.

Typedef Documentation

◆ t_arena

typedef struct s_arena t_arena

Definition at line 72 of file arena_stats.h.