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>

source

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>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Storage: ComputeStorage> MemoryManagement<Storage> for DynamicMemoryManagement<Storage>

§

type Handle = MemoryPoolHandle

The associated type that must implement MemoryHandle.
§

type Binding = MemoryPoolBinding

The associated type that must implement MemoryBinding
source§

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

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

Bypass the memory allocation algorithm to allocate data directly. Read more
source§

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

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V