pub struct AsyncAllocatorCounter<T> {
pub allocator: T,
}
Expand description
Allocator wrapper
this allocator will measure how much data is allocated in the future that is currently executed
Set t up as follows:
use async_alloc_counter::AsyncAllocatorCounter;
use std::{alloc::System, time::Duration};
#[global_allocator]
static GLOBAL: AsyncAllocatorCounter<System> = AsyncAllocatorCounter { allocator: System };
Fields§
§allocator: T
Trait Implementations§
Source§impl<T: GlobalAlloc> GlobalAlloc for AsyncAllocatorCounter<T>
impl<T: GlobalAlloc> GlobalAlloc for AsyncAllocatorCounter<T>
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<T> Freeze for AsyncAllocatorCounter<T>where
T: Freeze,
impl<T> RefUnwindSafe for AsyncAllocatorCounter<T>where
T: RefUnwindSafe,
impl<T> Send for AsyncAllocatorCounter<T>where
T: Send,
impl<T> Sync for AsyncAllocatorCounter<T>where
T: Sync,
impl<T> Unpin for AsyncAllocatorCounter<T>where
T: Unpin,
impl<T> UnwindSafe for AsyncAllocatorCounter<T>where
T: 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