pub struct DefaultAllocator;Expand description
Default CPU allocator using system memory.
Implementations§
Source§impl DefaultAllocator
impl DefaultAllocator
Sourcepub fn allocate<T: Scalar>(&self, count: usize) -> Result<*mut T>
pub fn allocate<T: Scalar>(&self, count: usize) -> Result<*mut T>
Allocates memory for count elements of type T.
Sourcepub unsafe fn deallocate<T: Scalar>(&self, ptr: *mut T, count: usize)
pub unsafe fn deallocate<T: Scalar>(&self, ptr: *mut T, count: usize)
Deallocates memory previously allocated.
§Safety
The pointer must have been allocated by this allocator.
Sourcepub fn total_memory(&self) -> usize
pub fn total_memory(&self) -> usize
Returns the total memory available on the device.
Sourcepub fn free_memory(&self) -> usize
pub fn free_memory(&self) -> usize
Returns the currently free memory on the device.
Trait Implementations§
Source§impl Allocator for DefaultAllocator
impl Allocator for DefaultAllocator
Source§impl Clone for DefaultAllocator
impl Clone for DefaultAllocator
Source§fn clone(&self) -> DefaultAllocator
fn clone(&self) -> DefaultAllocator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefaultAllocator
impl Debug for DefaultAllocator
Source§impl Default for DefaultAllocator
impl Default for DefaultAllocator
Source§fn default() -> DefaultAllocator
fn default() -> DefaultAllocator
Returns the “default value” for a type. Read more
impl Copy for DefaultAllocator
Auto Trait Implementations§
impl Freeze for DefaultAllocator
impl RefUnwindSafe for DefaultAllocator
impl Send for DefaultAllocator
impl Sync for DefaultAllocator
impl Unpin for DefaultAllocator
impl UnwindSafe for DefaultAllocator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more