Skip to main content

install_global_allocator

Macro install_global_allocator 

Source
macro_rules! install_global_allocator {
    () => { ... };
}
Expand description

Install TrackingAlloc over the system allocator as this program’s #[global_allocator].

#[global_allocator] is a per-program item, so every binary, test binary, and benchmark that should count its own heap invokes this once at its crate root. A program without it runs on Rust’s default allocator and reports no memory at all, which is what crate::memory::stats returning None means.

concinnity_core::install_global_allocator!();