Expand description
jemalloc allocator
Re-exportsΒ§
use std::alloc::Layout;πuse std::io::Write;πuse std::panic::catch_unwind;πuse std::process::abort;πuse std::sync::atomic::AtomicBool;πuse std::sync::atomic::AtomicU64;πuse std::sync::atomic::Ordering;πuse const_str::concat_bytes;πuse jevmalloc::Jemalloc;πuse jevmalloc::global::hook::ALLOC;πuse jevmalloc::global::hook::ALLOC_ZEROED;πuse jevmalloc::stats::print as print_stats;πuse libc::c_char;πuse libc::STDOUT_FILENO;πuse libc::c_void;πuse libc::write;πuse crate::arrayvec::ArrayVec;πuse crate::utils::BoolExt;π
ModulesΒ§
- this_
thread - Exposes jemalloc state controls associated with the calling thread.
ConstantsΒ§
- MALLOC_
CONF π - MALLOC_
CONF_ πBACKGROUND - MALLOC_
CONF_ πMETADATA_ THP - Asks jemalloc to back allocator metadata with huge pages where it can.
- MALLOC_
CONF_ πPERCPU_ ARENA - Assigns arenas by CPU where jemalloc can tell which CPU a thread runs on.
- _MALLOC_
CONF_ πPROF
StaticsΒ§
- COUNT_
GLOBAL_ πALLOCS - GLOBAL_
ALLOCS π - JEMALLOC π
- MALLOC_
CONF_ PREFIXED - Provides the jemalloc startup configuration under the symbol name a prefixed build reads.
- TRACE_
GLOBAL_ πALLOCS - malloc_
conf - Provides the process-wide jemalloc startup configuration.
FunctionsΒ§
- _static_
initialization π - Registers the allocation-observer callbacks during process startup.
- background_
thread_ enable - Enables or disables jemallocβs background purge workers.
- global_
alloc_ count - Returns the process allocation count observed by the allocator hook.
- global_
alloc_ πhook - global_
alloc_ πzeroed_ hook - handle_
global_ πalloc - memory_
stats - Collects jemallocβs UTF-8 statistics report with the supplied print options.
- trim
- Reclaims unused pages from every initialized arena.
Type AliasesΒ§
- Trace
Line π - Line buffer for one allocation-trace record. A record of three integers at their maximum widths occupies 74 bytes.