Expand description
An instrumenting allocator wrapper to compute (scoped) peak memory consumption.
§Example
use peakmem_alloc::*;
use std::alloc::System;
#[global_allocator]
static GLOBAL: &PeakMemAlloc<System> = &INSTRUMENTED_SYSTEM;
fn main() {
   GLOBAL.reset_peak_memory();
   let _x: Vec<u8> = Vec::with_capacity(1_024);
   println!(
       "Peak Memory used by function : {:#?}",
       GLOBAL.get_peak_memory()
   );
}Structs§
- Peak
MemAlloc  - An allocator middleware which keeps track of peak memory consumption.
 
Statics§
- INSTRUMENTED_
SYSTEM  - An instrumented instance of the system allocator.
 
Traits§
- Peak
MemAlloc Trait  - The PeakAllocTrait trait provides a common interface for all allocators.