pub struct PeakMemAlloc<T: GlobalAlloc> { /* private fields */ }Expand description
An allocator middleware which keeps track of peak memory consumption.
Implementations§
Source§impl PeakMemAlloc<System>
impl PeakMemAlloc<System>
Source§impl<T: GlobalAlloc> PeakMemAlloc<T>
impl<T: GlobalAlloc> PeakMemAlloc<T>
Trait Implementations§
Source§impl<T: Debug + GlobalAlloc> Debug for PeakMemAlloc<T>
impl<T: Debug + GlobalAlloc> Debug for PeakMemAlloc<T>
Source§impl<T: Default + GlobalAlloc> Default for PeakMemAlloc<T>
impl<T: Default + GlobalAlloc> Default for PeakMemAlloc<T>
Source§fn default() -> PeakMemAlloc<T>
fn default() -> PeakMemAlloc<T>
Returns the “default value” for a type. Read more
Source§impl<'a, T: GlobalAlloc + 'a> GlobalAlloc for &'a PeakMemAlloc<T>
impl<'a, T: GlobalAlloc + 'a> GlobalAlloc for &'a PeakMemAlloc<T>
Source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout. Read moreSource§impl<T: GlobalAlloc> GlobalAlloc for PeakMemAlloc<T>
impl<T: GlobalAlloc> GlobalAlloc for PeakMemAlloc<T>
Source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout. Read moreSource§impl<T: GlobalAlloc> PeakMemAllocTrait for PeakMemAlloc<T>
impl<T: GlobalAlloc> PeakMemAllocTrait for PeakMemAlloc<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 PeakMemAlloc<T>
impl<T> RefUnwindSafe for PeakMemAlloc<T>where
T: RefUnwindSafe,
impl<T> Send for PeakMemAlloc<T>where
T: Send,
impl<T> Sync for PeakMemAlloc<T>where
T: Sync,
impl<T> Unpin for PeakMemAlloc<T>where
T: Unpin,
impl<T> UnwindSafe for PeakMemAlloc<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