Skip to main content

mi_stats_t

Struct mi_stats_t 

Source
#[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: usize

sizeof(mi_stats_t) as the C library sees it.

§version: usize

MI_STAT_VERSION as the C library sees it.

§pages: mi_stat_count_t

Count of mimalloc pages.

§reserved: mi_stat_count_t

Reserved memory bytes.

§committed: mi_stat_count_t

Committed bytes.

§reset: mi_stat_counter_t

Reset bytes.

§purged: mi_stat_counter_t

Purged bytes.

§page_committed: mi_stat_count_t

Committed memory inside pages.

§pages_abandoned: mi_stat_count_t

Abandoned page count.

§threads: mi_stat_count_t

Number of threads.

§malloc_normal: mi_stat_count_t

Allocated bytes <= MI_LARGE_OBJ_SIZE_MAX.

§malloc_huge: mi_stat_count_t

Allocated bytes in huge pages.

§malloc_requested: mi_stat_count_t

Bytes the application actually asked for; only maintained at MI_STAT >= 2.

§mmap_calls: mi_stat_counter_t

mmap/VirtualAlloc calls.

§commit_calls: mi_stat_counter_t

Commit calls.

§reset_calls: mi_stat_counter_t

Reset calls.

§purge_calls: mi_stat_counter_t

Purge calls.

§arena_count: mi_stat_counter_t

Number of memory arenas.

§malloc_normal_count: mi_stat_counter_t

Number of blocks <= MI_LARGE_OBJ_SIZE_MAX.

§malloc_huge_count: mi_stat_counter_t

Number of huge blocks.

§malloc_guarded_count: mi_stat_counter_t

Number of allocations with guard pages.

§arena_rollback_count: mi_stat_counter_t

Internal: arena rollbacks.

§arena_purges: mi_stat_counter_t

Internal: arena purges.

§pages_extended: mi_stat_counter_t

Internal: page extensions.

§pages_retire: mi_stat_counter_t

Internal: retired pages.

§page_searches: mi_stat_counter_t

Internal: total pages searched for a fresh page.

§page_searches_count: mi_stat_counter_t

Internal: searched count for a fresh page.

§segments: mi_stat_count_t

v1/v2 only; always zero on this v3 line.

§segments_abandoned: mi_stat_count_t

v1/v2 only; always zero on this v3 line.

§segments_cache: mi_stat_count_t

v1/v2 only; always zero on this v3 line.

§_segments_reserved: mi_stat_count_t

v1/v2 only; always zero on this v3 line.

§heaps: mi_stat_count_t

v3 only: first-class heaps.

§theaps: mi_stat_count_t

v3 only: thread-local heaps (mi_theap_t).

§pages_reclaim_on_alloc: mi_stat_counter_t

v3 only: pages reclaimed on allocation.

§pages_reclaim_on_free: mi_stat_counter_t

v3 only: pages reclaimed on free.

§pages_reabandon_full: mi_stat_counter_t

v3 only: full pages re-abandoned.

§pages_unabandon_busy_wait: mi_stat_counter_t

v3 only: busy waits while unabandoning a page.

§heaps_delete_wait: mi_stat_counter_t

v3 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

Source§

fn clone(&self) -> mi_stats_t

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for mi_stats_t

Source§

impl Debug for mi_stats_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.