pub struct MemoryRegistry { /* private fields */ }Expand description
Perform memory region allocation by reusing system memory.
Implementations§
Source§impl MemoryRegistry
impl MemoryRegistry
Sourcepub fn alloc(
&mut self,
min_size: usize,
tag: Option<&str>,
) -> Option<MemoryRegion>
pub fn alloc( &mut self, min_size: usize, tag: Option<&str>, ) -> Option<MemoryRegion>
Allocate a MemoryRegion from the MemoryRegistry, actual size may be larger than min_size.
pub fn alloc_with_free( &mut self, min_size: usize, tag: Option<&str>, free: impl FnOnce() + 'static, ) -> Option<MemoryRegion>
pub fn maintain(&mut self)
Trait Implementations§
Source§impl Default for MemoryRegistry
impl Default for MemoryRegistry
Source§fn default() -> MemoryRegistry
fn default() -> MemoryRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryRegistry
impl !RefUnwindSafe for MemoryRegistry
impl !Send for MemoryRegistry
impl !Sync for MemoryRegistry
impl Unpin for MemoryRegistry
impl !UnwindSafe for MemoryRegistry
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