pub struct ZeroingAllocator;Expand description
An allocator that zeroes memory as it is freed. A module pre-initialized with Wizer keeps only its memory’s non-zero bytes, so with this it carries what start-up kept, not what it threw away.
ⓘ
#[global_allocator]
static ALLOCATOR: hammer::ZeroingAllocator = hammer::ZeroingAllocator;Trait Implementations§
Source§impl GlobalAlloc for ZeroingAllocator
impl GlobalAlloc for ZeroingAllocator
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 Freeze for ZeroingAllocator
impl RefUnwindSafe for ZeroingAllocator
impl Send for ZeroingAllocator
impl Sync for ZeroingAllocator
impl Unpin for ZeroingAllocator
impl UnsafeUnpin for ZeroingAllocator
impl UnwindSafe for ZeroingAllocator
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