Struct trallocator::Trallocator
source · pub struct Trallocator<A> { /* private fields */ }
Expand description
A wapper over an allocator that allows tracebility
Implementations§
source§impl<A> Trallocator<A>
impl<A> Trallocator<A>
sourcepub const fn new(alloc: A) -> Self
pub const fn new(alloc: A) -> Self
Creates a new instance of the traceable allocator using an inner allocator
sourcepub fn borrow(&self) -> &A
pub fn borrow(&self) -> &A
Borrow the inner allocator. Note that using the inner allocator will prevent the allocation to be tracked. Should only be used to init the inner allocator
sourcepub fn borrow_mut(&mut self) -> &mut A
pub fn borrow_mut(&mut self) -> &mut A
Mutably borrow the inner allocator. Note that using the inner allocator will prevent the allocation to be tracked. Should only be used to init the inner allocator
Trait Implementations§
source§impl<A: GlobalAlloc> GlobalAlloc for Trallocator<A>
impl<A: GlobalAlloc> GlobalAlloc for Trallocator<A>
source§unsafe fn alloc(&self, l: Layout) -> *mut u8
unsafe fn alloc(&self, l: Layout) -> *mut u8
Allocate memory as described by the given
layout
. Read moreAuto Trait Implementations§
impl<A> RefUnwindSafe for Trallocator<A>where
A: RefUnwindSafe,
impl<A> Send for Trallocator<A>where
A: Send,
impl<A> Sync for Trallocator<A>where
A: Sync,
impl<A> Unpin for Trallocator<A>where
A: Unpin,
impl<A> UnwindSafe for Trallocator<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