pub struct MiMalloc;
Expand description
Drop-in mimalloc global allocator.
Usage
ⓘ
use mimalloc::MiMalloc;
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
Trait Implementations
sourceimpl GlobalAlloc for MiMalloc
impl GlobalAlloc for MiMalloc
sourceunsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocate memory as described by the given
layout
. Read moresourceunsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
Behaves like
alloc
, but also ensures that the contents
are set to zero before being returned. Read moreAuto Trait Implementations
impl RefUnwindSafe for MiMalloc
impl Send for MiMalloc
impl Sync for MiMalloc
impl Unpin for MiMalloc
impl UnwindSafe for MiMalloc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more