#[repr(C)]pub struct mi_stats_t {Show 43 fields
pub size: usize,
pub version: usize,
pub pages: mi_stat_count_t,
pub reserved: mi_stat_count_t,
pub committed: mi_stat_count_t,
pub reset: mi_stat_counter_t,
pub purged: mi_stat_counter_t,
pub page_committed: mi_stat_count_t,
pub pages_abandoned: mi_stat_count_t,
pub threads: mi_stat_count_t,
pub malloc_normal: mi_stat_count_t,
pub malloc_huge: mi_stat_count_t,
pub malloc_requested: mi_stat_count_t,
pub mmap_calls: mi_stat_counter_t,
pub commit_calls: mi_stat_counter_t,
pub reset_calls: mi_stat_counter_t,
pub purge_calls: mi_stat_counter_t,
pub arena_count: mi_stat_counter_t,
pub malloc_normal_count: mi_stat_counter_t,
pub malloc_huge_count: mi_stat_counter_t,
pub malloc_guarded_count: mi_stat_counter_t,
pub arena_rollback_count: mi_stat_counter_t,
pub arena_purges: mi_stat_counter_t,
pub pages_extended: mi_stat_counter_t,
pub pages_retire: mi_stat_counter_t,
pub page_searches: mi_stat_counter_t,
pub page_searches_count: mi_stat_counter_t,
pub segments: mi_stat_count_t,
pub segments_abandoned: mi_stat_count_t,
pub segments_cache: mi_stat_count_t,
pub _segments_reserved: mi_stat_count_t,
pub heaps: mi_stat_count_t,
pub theaps: mi_stat_count_t,
pub pages_reclaim_on_alloc: mi_stat_counter_t,
pub pages_reclaim_on_free: mi_stat_counter_t,
pub pages_reabandon_full: mi_stat_counter_t,
pub pages_unabandon_busy_wait: mi_stat_counter_t,
pub heaps_delete_wait: mi_stat_counter_t,
pub _stat_reserved: [mi_stat_count_t; 4],
pub _stat_counter_reserved: [mi_stat_counter_t; 4],
pub malloc_bins: [mi_stat_count_t; 74],
pub page_bins: [mi_stat_count_t; 74],
pub chunk_bins: [mi_stat_count_t; 6],
}Expand description
Mirrors mi_stats_t (include/mimalloc-stats.h) field-for-field, including the
reserved-for-future-use arrays and the three size-segregated bin arrays.
This is upstream’s struct, unchanged by the fork – in particular it carries no
hole-purging or idle-sweep gauges. Those live in MiPurgeHolesStats, because the
sweep also covers pages no heap owns and mi_stats_t cannot grow (it is embedded in
a theap, at the meta-allocator’s 8 KB block limit).
Field order, offsets and total size are checked against the C library at test time by
tests/t19_layout.rs (see layout_probe.c), which walks the header’s own
MI_STAT_FIELDS list – so an upstream reordering fails loudly instead of silently
reading the wrong counter.
Fields§
§size: usizesizeof(mi_stats_t) as the C library sees it.
version: usizeMI_STAT_VERSION as the C library sees it.
pages: mi_stat_count_tCount of mimalloc pages.
reserved: mi_stat_count_tReserved memory bytes.
committed: mi_stat_count_tCommitted bytes.
reset: mi_stat_counter_tReset bytes.
purged: mi_stat_counter_tPurged bytes.
page_committed: mi_stat_count_tCommitted memory inside pages.
pages_abandoned: mi_stat_count_tAbandoned page count.
threads: mi_stat_count_tNumber of threads.
malloc_normal: mi_stat_count_tAllocated bytes <= MI_LARGE_OBJ_SIZE_MAX.
malloc_huge: mi_stat_count_tAllocated bytes in huge pages.
malloc_requested: mi_stat_count_tBytes the application actually asked for; only maintained at MI_STAT >= 2.
mmap_calls: mi_stat_counter_tmmap/VirtualAlloc calls.
commit_calls: mi_stat_counter_tCommit calls.
reset_calls: mi_stat_counter_tReset calls.
purge_calls: mi_stat_counter_tPurge calls.
arena_count: mi_stat_counter_tNumber of memory arenas.
malloc_normal_count: mi_stat_counter_tNumber of blocks <= MI_LARGE_OBJ_SIZE_MAX.
malloc_huge_count: mi_stat_counter_tNumber of huge blocks.
malloc_guarded_count: mi_stat_counter_tNumber of allocations with guard pages.
arena_rollback_count: mi_stat_counter_tInternal: arena rollbacks.
arena_purges: mi_stat_counter_tInternal: arena purges.
pages_extended: mi_stat_counter_tInternal: page extensions.
pages_retire: mi_stat_counter_tInternal: retired pages.
page_searches: mi_stat_counter_tInternal: total pages searched for a fresh page.
page_searches_count: mi_stat_counter_tInternal: searched count for a fresh page.
segments: mi_stat_count_tv1/v2 only; always zero on this v3 line.
segments_abandoned: mi_stat_count_tv1/v2 only; always zero on this v3 line.
segments_cache: mi_stat_count_tv1/v2 only; always zero on this v3 line.
_segments_reserved: mi_stat_count_tv1/v2 only; always zero on this v3 line.
heaps: mi_stat_count_tv3 only: first-class heaps.
theaps: mi_stat_count_tv3 only: thread-local heaps (mi_theap_t).
pages_reclaim_on_alloc: mi_stat_counter_tv3 only: pages reclaimed on allocation.
pages_reclaim_on_free: mi_stat_counter_tv3 only: pages reclaimed on free.
pages_reabandon_full: mi_stat_counter_tv3 only: full pages re-abandoned.
pages_unabandon_busy_wait: mi_stat_counter_tv3 only: busy waits while unabandoning a page.
heaps_delete_wait: mi_stat_counter_tv3 only: waits while deleting a heap.
_stat_reserved: [mi_stat_count_t; 4]Upstream’s future-extension padding; do not read.
_stat_counter_reserved: [mi_stat_counter_t; 4]Upstream’s future-extension padding; do not read.
malloc_bins: [mi_stat_count_t; 74]Allocation per size bin.
page_bins: [mi_stat_count_t; 74]Pages allocated per size bin.
chunk_bins: [mi_stat_count_t; 6]Chunks per page size (mi_chunkbin_t).
Trait Implementations§
Source§impl Clone for mi_stats_t
impl Clone for mi_stats_t
Source§fn clone(&self) -> mi_stats_t
fn clone(&self) -> mi_stats_t
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more