PeakMemAllocTrait

Trait PeakMemAllocTrait 

Source
pub trait PeakMemAllocTrait {
    // Required methods
    fn reset_peak_memory(&self);
    fn get_peak_memory(&self) -> usize;
}
Expand description

The PeakAllocTrait trait provides a common interface for all allocators.

This is mainly to allow for generic functions that can work with any allocator with type erasure.

Required Methods§

Source

fn reset_peak_memory(&self)

Resets the peak memory to 0

Source

fn get_peak_memory(&self) -> usize

Get the peak memory consumption. This is the maximum that has been allocated since the last reset.

Note that allocations of other threads may interfere with a measurement of a scope.

Implementors§