Skip to main content

HostAllocator

Struct HostAllocator 

Source
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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Copy for HostAllocator

Source§

impl Debug for HostAllocator

Source§

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

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

impl Default for HostAllocator

Source§

fn default() -> HostAllocator

Returns the “default value” for a type. Read more
Source§

impl DeviceAllocator for HostAllocator

Source§

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)

Give back a whole allocation returned by this allocator or by the VirtualBacking capability discovered from this allocator. Read more
Source§

fn device(&self) -> DeviceKey

Source§

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

Give back a whole allocation and report a structured outcome. Read more
Source§

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>

Discover lazy reserve/commit/decommit support from this selected allocator reference.
Source§

fn as_shared_mapping(&self) -> Option<&dyn SharedMapping>

Discover shared physical mapping support independently from virtual backing support.

Auto Trait Implementations§

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> BindingResource for T
where T: Send + Sync + Debug,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.