pub trait ComputeStorage: Send {
type Resource: Send;
// Required methods
fn alignment(&self) -> usize;
fn get(&mut self, handle: &StorageHandle) -> Self::Resource;
fn alloc(&mut self, size: u64) -> StorageHandle;
fn dealloc(&mut self, id: StorageId);
}
Expand description
Storage types are responsible for allocating and deallocating memory.
Required Associated Types§
Required Methods§
Sourcefn get(&mut self, handle: &StorageHandle) -> Self::Resource
fn get(&mut self, handle: &StorageHandle) -> Self::Resource
Returns the underlying resource for a specified storage handle
Sourcefn alloc(&mut self, size: u64) -> StorageHandle
fn alloc(&mut self, size: u64) -> StorageHandle
Allocates size
units of memory and returns a handle to it