Skip to main content

Module stats

Module stats 

Source
Expand description

The allocator’s own exact statistics, as opposed to the sampled numbers crate::prof::stats reports.

This is upstream mimalloc’s mimalloc-stats.h surface. Note what is not here: hole-purging and idle-sweep gauges are not part of mi_stats_t — they live in crate::purge_holes_stats, because the sweep also covers pages that no heap owns and mi_stats_t cannot grow (it is embedded in a theap, at the meta-allocator’s 8 KB block limit).

malloc_requested is only maintained when the C library was built with MI_STAT >= 2 (upstream enables that for debug builds only); a default release build reports 0 for it and for nothing else.

Structs§

Stats
An owned copy of mi_stats_t, boxed because it is ~4 KB.

Enums§

Subproc
Which subprocess a subprocess-scoped call refers to.

Functions§

bin_size
The block size served by size bin bin (0..=sys::MI_BIN_HUGE), matching the malloc_bins/page_bins indices.
get
Statistics for the current subprocess and all its heaps, aggregated.
json
The same statistics as get, rendered as JSON by the C library.
print
Print the current subprocess’s statistics to mimalloc’s output sink.
subproc_get
Statistics for one subprocess and all its heaps, aggregated.
subproc_get_exclusive
Statistics for one subprocess without aggregating its heaps.
subproc_heap_print
Print one subprocess and each of its heaps separately to mimalloc’s output sink.
subproc_json
One subprocess’s aggregated statistics as JSON.
subproc_print
Print one subprocess’s aggregated statistics to mimalloc’s output sink.