Skip to main content

Module stats

Module stats 

Source
Expand description

StatsBump: bump arena with runtime counters for observability.

Tracks:

  • allocations - total alloc_* calls served (excluding refusals).
  • bytes_used - sum of allocation size values (excludes padding).
  • bytes_wasted - sum of alignment padding inserted between allocations.
  • peak_bytes - high-watermark of cursor across this arena’s lifetime.
  • chunk_count - number of distinct chunks the arena has ever opened (grows monotonically; this struct also auto-grows so the counter is meaningful).

Counters survive reset() so a long-running process can read lifetime aggregates. clear_stats() zeros them.

Structs§

BumpStats
Snapshot of runtime counters.
StatsBump
Bump arena with instrumentation. Auto-grows like GrowableBump.