pub struct TrackAllocator<A>where
A: GlobalAlloc,{
pub allocator: A,
pub counter: AtomicUsize,
pub peak: AtomicUsize,
}
Fields§
§allocator: A
§counter: AtomicUsize
§peak: AtomicUsize
Implementations§
Source§impl<A> TrackAllocator<A>where
A: GlobalAlloc,
impl<A> TrackAllocator<A>where
A: GlobalAlloc,
pub fn get(&self) -> usize
pub fn counter(&'static self) -> &'static AtomicUsize
pub fn peak(&'static self) -> &'static AtomicUsize
Trait Implementations§
Source§impl<A> GlobalAlloc for TrackAllocator<A>where
A: GlobalAlloc,
impl<A> GlobalAlloc for TrackAllocator<A>where
A: GlobalAlloc,
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 moreAuto Trait Implementations§
impl<A> !Freeze for TrackAllocator<A>
impl<A> RefUnwindSafe for TrackAllocator<A>where
A: RefUnwindSafe,
impl<A> Send for TrackAllocator<A>where
A: Send,
impl<A> Sync for TrackAllocator<A>where
A: Sync,
impl<A> Unpin for TrackAllocator<A>where
A: Unpin,
impl<A> UnwindSafe for TrackAllocator<A>where
A: 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