pub struct MmapBlock { /* private fields */ }Expand description
A raw block of writable virtual memory allocated from the operating system.
Implementations§
Source§impl MmapBlock
impl MmapBlock
Sourcepub fn new(len: usize) -> Result<Self>
pub fn new(len: usize) -> Result<Self>
Allocate a new anonymous writable mapping.
§Errors
Returns an error if len is zero or the underlying mmap fails.
Sourcepub fn new_on_node(len: usize, node: u32) -> Result<Self>
pub fn new_on_node(len: usize, node: u32) -> Result<Self>
Allocate a new mapping and bind it to a NUMA node when supported.
§Errors
Returns an error if len is zero, if mmap fails, or if the NUMA
node is invalid or binding fails.
Sourcepub fn as_mut_ptr(&mut self) -> *mut u8
pub fn as_mut_ptr(&mut self) -> *mut u8
Mutable raw pointer to the start of the mapping.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MmapBlock
impl RefUnwindSafe for MmapBlock
impl !Sync for MmapBlock
impl Unpin for MmapBlock
impl UnsafeUnpin for MmapBlock
impl UnwindSafe for MmapBlock
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