Struct perf_monitor::mem::CountingAllocator
source · pub struct CountingAllocator;
Expand description
An allocator tracks inuse allocated bytes.
The counter is disable by default. Please enable it by CountingAllocator::enable()
then call CountingAllocator::get_allocated()
will return the bytes inused.
Implementations§
Trait Implementations§
source§impl GlobalAlloc for CountingAllocator
impl GlobalAlloc for CountingAllocator
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 moreAuto Trait Implementations§
impl Freeze for CountingAllocator
impl RefUnwindSafe for CountingAllocator
impl Send for CountingAllocator
impl Sync for CountingAllocator
impl Unpin for CountingAllocator
impl UnwindSafe for CountingAllocator
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