pub struct MiMalloc;
Expand description
A global allocator using the system’s shared mimalloc library.
To use the allocator in your program, add either of the two code snippets to your main.rs
:
ⓘ
system_mimalloc::use_mimalloc!();
ⓘ
use system_mimalloc::MiMalloc;
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
Trait Implementations§
Source§impl GlobalAlloc for MiMalloc
impl GlobalAlloc for MiMalloc
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 moreimpl Copy for MiMalloc
impl Eq for MiMalloc
impl StructuralPartialEq for MiMalloc
Auto Trait Implementations§
impl Freeze for MiMalloc
impl RefUnwindSafe for MiMalloc
impl Send for MiMalloc
impl Sync for MiMalloc
impl Unpin for MiMalloc
impl UnwindSafe for MiMalloc
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