pub struct Mockalloc<T: GlobalAlloc>(pub T);Expand description
Wraps an existing allocator to allow detecting allocation bugs.
You should use the #[global_allocator] attribute to activate
this allocator.
Tuple Fields§
§0: TTrait Implementations§
Source§impl<T: GlobalAlloc> GlobalAlloc for Mockalloc<T>
impl<T: GlobalAlloc> GlobalAlloc for Mockalloc<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 Mockalloc<T>where
T: Freeze,
impl<T> RefUnwindSafe for Mockalloc<T>where
T: RefUnwindSafe,
impl<T> Send for Mockalloc<T>where
T: Send,
impl<T> Sync for Mockalloc<T>where
T: Sync,
impl<T> Unpin for Mockalloc<T>where
T: Unpin,
impl<T> UnwindSafe for Mockalloc<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