pub struct MmapBox<T> { /* private fields */ }
Expand description
Analogous to alloc::boxed::Box
, but directly uses mmap
instead of a
global allocator.
Useful since we don’t currently have a global allocator in the shim, and
probably don’t want to install one that makes direct mmap
calls for every
allocation, since that would be a performance footgun.
We should be able to replace this with alloc::boxed::Box<T>
if and when we
implement a global allocator suitable for the shim. (Or with
alloc::boxed::Box<T, MmapAllocator>
when non-global allocators are
stabilized)
Implementations§
Trait Implementations§
impl<T> Send for MmapBox<T>where
T: Send,
impl<T> Sync for MmapBox<T>where
T: Sync,
Auto Trait Implementations§
impl<T> Freeze for MmapBox<T>
impl<T> RefUnwindSafe for MmapBox<T>where
T: RefUnwindSafe,
impl<T> Unpin for MmapBox<T>
impl<T> UnwindSafe for MmapBox<T>where
T: RefUnwindSafe,
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