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.
Source§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> Freeze for SimpleMemoryManagement<Storage>where
Storage: Freeze,
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