pub struct MimallocMutexWrapper<A: GlobalAlloc>(/* private fields */);Available on crate features
std_mutex or spin_mutex only.Expand description
Wrap Mimalloc inside a Mutex and implement GlobalAlloc.
Implementations§
Source§impl<A: GlobalAlloc> MimallocMutexWrapper<A>
impl<A: GlobalAlloc> MimallocMutexWrapper<A>
Sourcepub const fn with_os_allocator(os_alloc: A) -> Self
pub const fn with_os_allocator(os_alloc: A) -> Self
Sourcepub fn register_deferred_free(&self, hook: DeferredFreeHook<A>)
Available on crate feature deferred_free only.
pub fn register_deferred_free(&self, hook: DeferredFreeHook<A>)
deferred_free only.Sourcepub fn collect(&self)
pub fn collect(&self)
See Mimalloc::collect.
Trait Implementations§
Source§impl<A: Default + GlobalAlloc> Default for MimallocMutexWrapper<A>
impl<A: Default + GlobalAlloc> Default for MimallocMutexWrapper<A>
Source§fn default() -> MimallocMutexWrapper<A>
fn default() -> MimallocMutexWrapper<A>
Returns the “default value” for a type. Read more
Source§impl<A: GlobalAlloc> GlobalAlloc for MimallocMutexWrapper<A>
impl<A: GlobalAlloc> GlobalAlloc for MimallocMutexWrapper<A>
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<A> !Freeze for MimallocMutexWrapper<A>
impl<A> !RefUnwindSafe for MimallocMutexWrapper<A>
impl<A> Send for MimallocMutexWrapper<A>
impl<A> Sync for MimallocMutexWrapper<A>
impl<A> Unpin for MimallocMutexWrapper<A>where
A: Unpin,
impl<A> UnwindSafe for MimallocMutexWrapper<A>where
A: 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