pub struct HostAllocator;Expand description
Host memory from the global allocator.
This is intentionally eager-only: it implements no optional capability.
Trait Implementations§
Source§impl Clone for HostAllocator
impl Clone for HostAllocator
Source§fn clone(&self) -> HostAllocator
fn clone(&self) -> HostAllocator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HostAllocator
Source§impl Debug for HostAllocator
impl Debug for HostAllocator
Source§impl Default for HostAllocator
impl Default for HostAllocator
Source§fn default() -> HostAllocator
fn default() -> HostAllocator
Returns the “default value” for a type. Read more
Source§impl DeviceAllocator for HostAllocator
impl DeviceAllocator for HostAllocator
Source§fn allocate(
&self,
bytes: usize,
align: usize,
) -> Result<NonNull<u8>, MemoryError>
fn allocate( &self, bytes: usize, align: usize, ) -> Result<NonNull<u8>, MemoryError>
Take
bytes aligned to align.Source§unsafe fn deallocate(&self, ptr: NonNull<u8>, bytes: usize, align: usize)
unsafe fn deallocate(&self, ptr: NonNull<u8>, bytes: usize, align: usize)
Give back a whole allocation returned by this allocator or by the
VirtualBacking capability discovered from this allocator. Read morefn device(&self) -> DeviceKey
Source§unsafe fn deallocate_with_unmapped(
&self,
ptr: NonNull<u8>,
bytes: usize,
align: usize,
) -> u64
unsafe fn deallocate_with_unmapped( &self, ptr: NonNull<u8>, bytes: usize, align: usize, ) -> u64
Give back a whole allocation and report bytes whose global mapping
reference transitioned to unmapped. Read more
Source§unsafe fn release(
&self,
ptr: NonNull<u8>,
bytes: usize,
align: usize,
) -> AllocationReleaseOutcome
unsafe fn release( &self, ptr: NonNull<u8>, bytes: usize, align: usize, ) -> AllocationReleaseOutcome
Give back a whole allocation and report a structured outcome. Read more
Source§fn commits_on_demand(&self) -> bool
fn commits_on_demand(&self) -> bool
Whether this allocator maps physical memory lazily and charges a
governor as each physical commitment is made. Read more
Source§fn as_virtual_backing(&self) -> Option<&dyn VirtualBacking>
fn as_virtual_backing(&self) -> Option<&dyn VirtualBacking>
Discover lazy reserve/commit/decommit support from this selected
allocator reference.
Discover shared physical mapping support independently from virtual
backing support.
Auto Trait Implementations§
impl Freeze for HostAllocator
impl RefUnwindSafe for HostAllocator
impl Send for HostAllocator
impl Sync for HostAllocator
impl Unpin for HostAllocator
impl UnsafeUnpin for HostAllocator
impl UnwindSafe for HostAllocator
Blanket Implementations§
impl<T> BindingResource for T
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