pub struct SimpleMemoryManagement<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> SimpleMemoryManagement<Storage>
impl<Storage: ComputeStorage> SimpleMemoryManagement<Storage>
sourcepub fn new(
storage: Storage,
dealloc_strategy: DeallocStrategy,
slice_strategy: SliceStrategy
) -> Self
pub fn new( storage: Storage, dealloc_strategy: DeallocStrategy, slice_strategy: SliceStrategy ) -> Self
Creates a new instance using the given storage, deallocation strategy and slice strategy.
Trait Implementations§
source§impl<Storage> Debug for SimpleMemoryManagement<Storage>
impl<Storage> Debug for SimpleMemoryManagement<Storage>
source§impl<Storage: ComputeStorage> MemoryManagement<Storage> for SimpleMemoryManagement<Storage>
impl<Storage: ComputeStorage> MemoryManagement<Storage> for SimpleMemoryManagement<Storage>
source§fn get(&mut self, handle: &Self::Handle) -> Storage::Resource
fn get(&mut self, handle: &Self::Handle) -> Storage::Resource
Returns the resource from the storage, for the specified handle.
source§fn reserve(&mut self, size: usize) -> Self::Handle
fn reserve(&mut self, size: usize) -> Self::Handle
Reserves memory of specified size using the reserve algorithm, and return a handle to the reserved memory.
Also clean ups, removing unused slices, and chunks if permitted by deallocation strategy.
§type Handle = SimpleHandle
type Handle = SimpleHandle
The associated type Handle must implement MemoryHandle
source§fn alloc(&mut self, size: usize) -> Self::Handle
fn alloc(&mut self, size: usize) -> Self::Handle
Bypass the memory allocation algorithm to allocate data directly. Read more
source§fn dealloc(&mut self, handle: &Self::Handle)
fn dealloc(&mut self, handle: &Self::Handle)
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> RefUnwindSafe for SimpleMemoryManagement<Storage>where Storage: RefUnwindSafe,
impl<Storage> Send for SimpleMemoryManagement<Storage>where Storage: Send,
impl<Storage> Sync for SimpleMemoryManagement<Storage>where Storage: Sync,
impl<Storage> Unpin for SimpleMemoryManagement<Storage>where Storage: Unpin,
impl<Storage> UnwindSafe for SimpleMemoryManagement<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