#[non_exhaustive]pub struct ProfConfig {
pub mode: ProfConfigMode,
pub sample_interval: Option<usize>,
pub max_profiler_bytes: Option<usize>,
pub seed: Option<u64>,
pub accum: bool,
pub max_stack_depth: Option<usize>,
pub dump_at_exit: Option<PathBuf>,
pub dump_format: DumpFormat,
}Expand description
Ergonomic, Rust-facing sibling of mi_prof_config_t
(include/mimalloc/profile.h) for enable_heap_profiling_with.
Fields mirror the C struct one-for-one, but trade its 0/NULL-means-unset
raw-integer conventions for Option<T> and enums where that reads
better. #[non_exhaustive] + Default keeps future fields additive:
build from Default::default() and set the fields you need, e.g.
use mimalloc_pprof::ProfConfig;
let mut config = ProfConfig::default();
config.sample_interval = Some(4096);(Within this crate, struct-update syntax like
ProfConfig { sample_interval: Some(4096), ..Default::default() } also
works; #[non_exhaustive] only blocks struct-literal construction from
other crates, so new fields stay non-breaking for them.)
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mode: ProfConfigModeSee ProfConfigMode.
sample_interval: Option<usize>Average bytes between samples. None = env/default (512 KiB).
max_profiler_bytes: Option<usize>Budget (bytes) for profiler-internal persistent sampling state
(sample records, the stack intern table, interned stack entries).
None = unbudgeted (cap-bounded only).
seed: Option<u64>None = nondeterministic.
accum: bool§max_stack_depth: Option<usize>None = default (32); compile cap 128.
dump_at_exit: Option<PathBuf>Path to dump the profile to at process exit. None = no exit dump.
dump_format: DumpFormatFormat used for the exit dump. Ignored if dump_at_exit is None.
Trait Implementations§
Source§impl Clone for ProfConfig
impl Clone for ProfConfig
Source§fn clone(&self) -> ProfConfig
fn clone(&self) -> ProfConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more