Struct tantivy_stacker::MemoryArena
source · pub struct MemoryArena { /* private fields */ }
Expand description
The MemoryArena
Implementations§
source§impl MemoryArena
impl MemoryArena
sourcepub fn mem_usage(&self) -> usize
pub fn mem_usage(&self) -> usize
Returns an estimate in number of bytes
of resident memory consumed by the MemoryArena
.
Internally, it counts a number of 1MB
pages
and therefore delivers an upperbound.
pub fn is_empty(&self) -> bool
pub fn write_at<Item: Copy + 'static>(&mut self, addr: Addr, val: Item)
pub fn slice(&self, addr: Addr, len: usize) -> &[u8] ⓘ
pub fn slice_from(&self, addr: Addr) -> &[u8] ⓘ
pub fn slice_from_mut(&mut self, addr: Addr) -> &mut [u8] ⓘ
pub fn slice_mut(&mut self, addr: Addr, len: usize) -> &mut [u8] ⓘ
sourcepub fn allocate_space(&mut self, len: usize) -> Addr
pub fn allocate_space(&mut self, len: usize) -> Addr
Allocates len
bytes and returns the allocated address.
Trait Implementations§
source§impl Default for MemoryArena
impl Default for MemoryArena
source§fn default() -> MemoryArena
fn default() -> MemoryArena
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryArena
impl RefUnwindSafe for MemoryArena
impl Send for MemoryArena
impl Sync for MemoryArena
impl Unpin for MemoryArena
impl UnwindSafe for MemoryArena
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