pub struct CpuDeviceMemory {
total: usize,
allocated: AtomicUsize,
}Expand description
CPU device memory allocator.
Fields§
§total: usizeTotal simulated memory.
allocated: AtomicUsizeCurrent allocated memory.
Implementations§
Trait Implementations§
Source§impl DeviceMemory for CpuDeviceMemory
impl DeviceMemory for CpuDeviceMemory
Source§fn allocate_aligned(
&self,
size: usize,
alignment: usize,
) -> Result<Box<dyn GpuBuffer>>
fn allocate_aligned( &self, size: usize, alignment: usize, ) -> Result<Box<dyn GpuBuffer>>
Allocate device memory with alignment.
Source§fn total_memory(&self) -> usize
fn total_memory(&self) -> usize
Get total device memory.
Source§fn free_memory(&self) -> usize
fn free_memory(&self) -> usize
Get free device memory.
Auto Trait Implementations§
impl !Freeze for CpuDeviceMemory
impl RefUnwindSafe for CpuDeviceMemory
impl Send for CpuDeviceMemory
impl Sync for CpuDeviceMemory
impl Unpin for CpuDeviceMemory
impl UnwindSafe for CpuDeviceMemory
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.