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 more