Skip to main content

Opt

Struct Opt 

Source
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

Source

pub const PROF: Self

Fork addition. Enable the sampled profiler at process start (MIMALLOC_PROF).

Source

pub const PROF_SAMPLE_RATE: Self

Fork addition. Average byte interval between profiler samples.

Source

pub const PROF_BT_MAX: Self

Fork addition. Maximum captured stack depth for the profiler.

Source

pub const PROF_ACCUM: Self

Fork addition. Keep cumulative profiler counters until crate::prof::reset.

Source

pub const PROF_SEED: Self

Fork addition. Profiler sampling PRNG seed; 0 = nondeterministic.

Source

pub const PROF_MAX_BYTES: Self

Fork addition. Budget in bytes for profiler-internal arena memory.

Source

pub const MEMORY_EVENTS: Self

Fork addition. Enable crate::memory_events accounting (MIMALLOC_MEMORY_EVENTS).

Source

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.

Source

pub const SCAVENGER: Self

Fork addition (Bun). Run the background scavenger thread.

Source

pub const PURGE_HOLES: Self

Fork addition (Bun). Discard free blocks inside still-used pages on crate::on_thread_idle.

Source

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.

Source

pub const PURGE_HOLES_MIN_INTERVAL: Self

Fork addition (Bun). Minimum milliseconds between sweeps of one thread’s heaps.

Source

pub const PURGE_HOLES_FULL_EVERY: Self

Fork addition (Bun). Every N-th sweep walks every page; 0 disables.

Source

pub const PURGE_DELAY: Self

Upstream: milliseconds to delay purging, which the scavenger also honours.

Source

pub const SHOW_STATS: Self

Upstream: print statistics on process termination.

Source

pub const SHOW_ERRORS: Self

Upstream: print error messages.

Source

pub const VERBOSE: Self

Upstream: print verbose messages.

Source

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.

Source

pub fn as_raw(self) -> mi_option_t

The raw mi_option_t value.

Source

pub fn name(self) -> &'static str

The C enumerator’s name, e.g. mi_option_purge_holes.

Trait Implementations§

Source§

impl Clone for Opt

Source§

fn clone(&self) -> Opt

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 Opt

Source§

impl Debug for Opt

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Opt

Source§

impl Hash for Opt

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Opt

Source§

fn eq(&self, other: &Opt) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Opt

Auto Trait Implementations§

§

impl Freeze for Opt

§

impl RefUnwindSafe for Opt

§

impl Send for Opt

§

impl Sync for Opt

§

impl Unpin for Opt

§

impl UnsafeUnpin for Opt

§

impl UnwindSafe for Opt

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.