Struct peakmem_alloc::PeakAlloc
source · pub struct PeakAlloc<T: GlobalAlloc> { /* private fields */ }
Expand description
An allocator middleware which keeps track of peak memory consumption.
Implementations§
Trait Implementations§
source§impl<'a, T: GlobalAlloc + 'a> GlobalAlloc for &'a PeakAlloc<T>
impl<'a, T: GlobalAlloc + 'a> GlobalAlloc for &'a PeakAlloc<T>
source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocate memory as described by the given
layout
. Read moresource§impl<T: GlobalAlloc> GlobalAlloc for PeakAlloc<T>
impl<T: GlobalAlloc> GlobalAlloc for PeakAlloc<T>
source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocate memory as described by the given
layout
. Read moresource§impl<T: GlobalAlloc> PeakAllocTrait for PeakAlloc<T>
impl<T: GlobalAlloc> PeakAllocTrait for PeakAlloc<T>
source§fn reset_peak_memory(&self)
fn reset_peak_memory(&self)
Resets the peak memory to 0
source§fn get_peak_memory(&self) -> usize
fn get_peak_memory(&self) -> usize
Get the peak memory consumption
Auto Trait Implementations§
impl<T> !Freeze for PeakAlloc<T>
impl<T> RefUnwindSafe for PeakAlloc<T>where
T: RefUnwindSafe,
impl<T> Send for PeakAlloc<T>where
T: Send,
impl<T> Sync for PeakAlloc<T>where
T: Sync,
impl<T> Unpin for PeakAlloc<T>where
T: Unpin,
impl<T> UnwindSafe for PeakAlloc<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more