pub struct DynamicMemoryManagement<Storage> { /* private fields */ }
Expand description
Reserves and keeps track of chunks of memory in the storage, and slices upon these chunks.
Implementations§
source§impl<Storage: ComputeStorage> DynamicMemoryManagement<Storage>
impl<Storage: ComputeStorage> DynamicMemoryManagement<Storage>
sourcepub fn new(storage: Storage, options: DynamicMemoryManagementOptions) -> Self
pub fn new(storage: Storage, options: DynamicMemoryManagementOptions) -> Self
Creates a new instance using the given storage, merging_strategy strategy and slice strategy.
Trait Implementations§
source§impl<Storage> Debug for DynamicMemoryManagement<Storage>
impl<Storage> Debug for DynamicMemoryManagement<Storage>
source§impl<Storage: ComputeStorage> MemoryManagement<Storage> for DynamicMemoryManagement<Storage>
impl<Storage: ComputeStorage> MemoryManagement<Storage> for DynamicMemoryManagement<Storage>
§type Handle = MemoryPoolHandle
type Handle = MemoryPoolHandle
The associated type that must implement MemoryHandle.
§type Binding = MemoryPoolBinding
type Binding = MemoryPoolBinding
The associated type that must implement MemoryBinding
source§fn get(&mut self, binding: Self::Binding) -> Storage::Resource
fn get(&mut self, binding: Self::Binding) -> Storage::Resource
Returns the resource from the storage at the specified handle
source§fn reserve<Sync: FnOnce()>(&mut self, size: usize, sync: Sync) -> Self::Handle
fn reserve<Sync: FnOnce()>(&mut self, size: usize, sync: Sync) -> Self::Handle
Finds a spot in memory for a resource with the given size in bytes, and returns a handle to it
source§fn alloc<Sync: FnOnce()>(&mut self, size: usize, sync: Sync) -> Self::Handle
fn alloc<Sync: FnOnce()>(&mut self, size: usize, sync: Sync) -> Self::Handle
Bypass the memory allocation algorithm to allocate data directly. Read more
source§fn dealloc(&mut self, _binding: Self::Binding)
fn dealloc(&mut self, _binding: Self::Binding)
Bypass the memory allocation algorithm to deallocate data directly. Read more
source§fn storage(&mut self) -> &mut Storage
fn storage(&mut self) -> &mut Storage
Fetch the storage used by the memory manager. Read more
Auto Trait Implementations§
impl<Storage> Freeze for DynamicMemoryManagement<Storage>where
Storage: Freeze,
impl<Storage> RefUnwindSafe for DynamicMemoryManagement<Storage>where
Storage: RefUnwindSafe,
impl<Storage> Send for DynamicMemoryManagement<Storage>where
Storage: Send,
impl<Storage> Sync for DynamicMemoryManagement<Storage>where
Storage: Sync,
impl<Storage> Unpin for DynamicMemoryManagement<Storage>where
Storage: Unpin,
impl<Storage> UnwindSafe for DynamicMemoryManagement<Storage>where
Storage: 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