Skip to main content

Crate mimalloc_pprof

Crate mimalloc_pprof 

Source
Expand description

Rust global allocator support for the in-tree mimalloc build.

use mimalloc_pprof::{prof, MiMalloc};
#[global_allocator] static ALLOCATOR: MiMalloc = MiMalloc;
prof::start(512 * 1024);
prof::dump_file(std::path::Path::new("heap.prof"))?;

See the README’s Rust integration guide for frame-pointer and line-table build flags. Open the resulting profile with pprof -http=: app.exe heap.prof.

Modules§

prof
Safe controls for mimalloc’s sampled heap profiler.
sys
Raw bindings to the in-tree mimalloc static amalgamation.

Structs§

MiMalloc
A #[global_allocator] implementation backed by mimalloc.
ProfConfig
Ergonomic, Rust-facing sibling of mi_prof_config_t (include/mimalloc/profile.h) for enable_heap_profiling_with.

Enums§

DumpFormat
Output format for ProfConfig::dump_at_exit.
ProfConfigMode
How ProfConfig fields interact with the profiler’s environment variables and mi_option_* settings.

Functions§

enable_heap_profiling
Turn on sampled heap profiling at the default sample rate.
enable_heap_profiling_with
Turn on sampled heap profiling using a struct-based configuration.
expand
Try to grow an allocation in place, without moving it.
recalloc
Grow or shrink an allocation to count * size bytes, zeroing any newly-exposed tail.
rezalloc
Grow or shrink an allocation, zeroing any newly-exposed tail.
unwrapped_free
Free a pointer returned by unwrapped_malloc or unwrapped_realloc.
unwrapped_malloc
Allocate size bytes from mimalloc’s raw-OS-layer “unwrapped” path.
unwrapped_realloc
Resize a pointer returned by unwrapped_malloc or unwrapped_realloc.
usable_size
Bytes actually available in an allocation, which may exceed what was requested.