pub struct AllocatorStats<A> { /* private fields */ }Available on crate feature
unstable only.Expand description
Global allocator providing metrics on allocated memory
#[global_allocator]
static ALLOCATOR: AllocatorStats<std::alloc::System> = AllocatorStats::new(std::alloc::System);Setting this as the global allocator provides two counters:
elfo_allocated_bytes_total and elfo_deallocated_bytes_total, tracking
total allocated and deallocated memory in bytes.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Implementations§
Source§impl<A> AllocatorStats<A>
impl<A> AllocatorStats<A>
Trait Implementations§
Source§impl<A> GlobalAlloc for AllocatorStats<A>where
A: GlobalAlloc,
impl<A> GlobalAlloc for AllocatorStats<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 AllocatorStats<A>where
A: Freeze,
impl<A> RefUnwindSafe for AllocatorStats<A>where
A: RefUnwindSafe,
impl<A> Send for AllocatorStats<A>where
A: Send,
impl<A> Sync for AllocatorStats<A>where
A: Sync,
impl<A> Unpin for AllocatorStats<A>where
A: Unpin,
impl<A> UnsafeUnpin for AllocatorStats<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for AllocatorStats<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