Struct alloc_metrics::MetricAlloc
source · pub struct MetricAlloc<A: GlobalAlloc> { /* private fields */ }
Expand description
A global allocator type that tracks allocation metrics.
This type makes use of shared memory in order to aggregate metrics while still supporting arbitrary global allocator composition. Because of this, there should only ever be at most one instance of it (hence being a global allocator).
Implementations§
source§impl<A: GlobalAlloc> MetricAlloc<A>
impl<A: GlobalAlloc> MetricAlloc<A>
Trait Implementations§
source§impl<A: GlobalAlloc> GlobalAlloc for MetricAlloc<A>
impl<A: GlobalAlloc> GlobalAlloc for MetricAlloc<A>
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<A> RefUnwindSafe for MetricAlloc<A>where
A: RefUnwindSafe,
impl<A> Send for MetricAlloc<A>where
A: Send,
impl<A> Sync for MetricAlloc<A>where
A: Sync,
impl<A> Unpin for MetricAlloc<A>where
A: Unpin,
impl<A> UnwindSafe for MetricAlloc<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