pub struct CountingAllocator { /* private fields */ }
Expand description
A simple allocator that counts the number of bytes allocated and deallocated.
Implementations§
Source§impl CountingAllocator
impl CountingAllocator
pub const fn new() -> CountingAllocator
pub fn get_allocated(&self) -> usize
pub fn get_deallocated(&self) -> usize
pub fn reset(&self)
Trait Implementations§
Source§impl Default for CountingAllocator
impl Default for CountingAllocator
Source§fn default() -> CountingAllocator
fn default() -> CountingAllocator
Returns the “default value” for a type. Read more
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
Allocates 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