pub struct Opt(/* private fields */);Expand description
One mi_option_t setting.
The associated constants name this fork’s own options plus the handful of upstream
ones that interact with them; Opt::from_raw reaches any other enumerator in
sys — it range-checks against _mi_option_last, because the C side indexes an
array with this value and an out-of-range option would read out of bounds.
Implementations§
Source§impl Opt
impl Opt
Sourcepub const PROF: Self
pub const PROF: Self
Fork addition. Enable the sampled profiler at process start (MIMALLOC_PROF).
Sourcepub const PROF_SAMPLE_RATE: Self
pub const PROF_SAMPLE_RATE: Self
Fork addition. Average byte interval between profiler samples.
Sourcepub const PROF_BT_MAX: Self
pub const PROF_BT_MAX: Self
Fork addition. Maximum captured stack depth for the profiler.
Sourcepub const PROF_ACCUM: Self
pub const PROF_ACCUM: Self
Fork addition. Keep cumulative profiler counters until crate::prof::reset.
Sourcepub const PROF_MAX_BYTES: Self
pub const PROF_MAX_BYTES: Self
Fork addition. Budget in bytes for profiler-internal arena memory.
Sourcepub const MEMORY_EVENTS: Self
pub const MEMORY_EVENTS: Self
Fork addition. Enable crate::memory_events accounting
(MIMALLOC_MEMORY_EVENTS).
Sourcepub const PURGE_ZEROES: Self
pub const PURGE_ZEROES: Self
Fork addition, dead since #80. Parses, but has no effect. Kept so nothing
renumbers; unrelated to Opt::PURGE_HOLES_EAGER_ZERO.
Sourcepub const PURGE_HOLES: Self
pub const PURGE_HOLES: Self
Fork addition (Bun). Discard free blocks inside still-used pages on
crate::on_thread_idle.
Sourcepub const PURGE_HOLES_EAGER_ZERO: Self
pub const PURGE_HOLES_EAGER_ZERO: Self
Fork addition (Bun). Zero a range before discarding it, so a mis-scoped discard corrupts visibly. Forced on in debug builds.
Sourcepub const PURGE_HOLES_MIN_INTERVAL: Self
pub const PURGE_HOLES_MIN_INTERVAL: Self
Fork addition (Bun). Minimum milliseconds between sweeps of one thread’s heaps.
Sourcepub const PURGE_HOLES_FULL_EVERY: Self
pub const PURGE_HOLES_FULL_EVERY: Self
Fork addition (Bun). Every N-th sweep walks every page; 0 disables.
Sourcepub const PURGE_DELAY: Self
pub const PURGE_DELAY: Self
Upstream: milliseconds to delay purging, which the scavenger also honours.
Sourcepub const SHOW_STATS: Self
pub const SHOW_STATS: Self
Upstream: print statistics on process termination.
Sourcepub const SHOW_ERRORS: Self
pub const SHOW_ERRORS: Self
Upstream: print error messages.
Sourcepub fn from_raw(raw: mi_option_t) -> Option<Self>
pub fn from_raw(raw: mi_option_t) -> Option<Self>
Wrap a raw mi_option_t from sys, or None if it is not a real option.
The range check is load bearing: the C implementation indexes its option table with this value, so an out-of-range option is an out-of-bounds read.
Sourcepub fn as_raw(self) -> mi_option_t
pub fn as_raw(self) -> mi_option_t
The raw mi_option_t value.