Struct wasmtime_runtime::OnDemandInstanceAllocator

source ·
pub struct OnDemandInstanceAllocator { /* private fields */ }
Expand description

Represents the on-demand instance allocator.

Implementations§

source§

impl OnDemandInstanceAllocator

source

pub fn new( mem_creator: Option<Arc<dyn RuntimeMemoryCreator>>, stack_size: usize ) -> Self

Creates a new on-demand instance allocator.

Trait Implementations§

source§

impl Clone for OnDemandInstanceAllocator

source§

fn clone(&self) -> OnDemandInstanceAllocator

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for OnDemandInstanceAllocator

source§

fn default() -> Self

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

impl InstanceAllocatorImpl for OnDemandInstanceAllocator

source§

fn validate_module_impl( &self, _module: &Module, _offsets: &VMOffsets<HostPtr> ) -> Result<()>

Validate whether a module is allocatable by this instance allocator.
source§

fn increment_component_instance_count(&self) -> Result<()>

Increment the count of concurrent component instances that are currently allocated, if applicable. Read more
source§

fn decrement_component_instance_count(&self)

The dual of increment_component_instance_count.
source§

fn increment_core_instance_count(&self) -> Result<()>

Increment the count of concurrent core module instances that are currently allocated, if applicable. Read more
source§

fn decrement_core_instance_count(&self)

The dual of increment_core_instance_count.
source§

unsafe fn allocate_memory( &self, request: &mut InstanceAllocationRequest<'_>, memory_plan: &MemoryPlan, memory_index: DefinedMemoryIndex ) -> Result<(MemoryAllocationIndex, Memory)>

Allocate a memory for an instance. Read more
source§

unsafe fn deallocate_memory( &self, _memory_index: DefinedMemoryIndex, allocation_index: MemoryAllocationIndex, _memory: Memory )

Deallocate an instance’s previously allocated memory. Read more
source§

unsafe fn allocate_table( &self, request: &mut InstanceAllocationRequest<'_>, table_plan: &TablePlan, _table_index: DefinedTableIndex ) -> Result<(TableAllocationIndex, Table)>

Allocate a table for an instance. Read more
source§

unsafe fn deallocate_table( &self, _table_index: DefinedTableIndex, allocation_index: TableAllocationIndex, _table: Table )

Deallocate an instance’s previously allocated table. Read more
source§

fn purge_module(&self, _: CompiledModuleId)

Purges all lingering resources related to module from within this allocator. Read more
source§

fn next_available_pkey(&self) -> Option<ProtectionKey>

Use the next available protection key. Read more
source§

fn restrict_to_pkey(&self, _: ProtectionKey)

Restrict access to memory regions protected by pkey. Read more
source§

fn allow_all_pkeys(&self)

Allow access to memory regions protected by any protection key.

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> 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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> InstanceAllocator for T

source§

fn validate_module( &self, module: &Module, offsets: &VMOffsets<HostPtr> ) -> Result<()>

Validate whether a core module is allocatable with this instance allocator.
source§

unsafe fn allocate_module( &self, request: InstanceAllocationRequest<'_> ) -> Result<InstanceHandle>

Allocates a fresh InstanceHandle for the req given. Read more
source§

unsafe fn deallocate_module(&self, handle: &mut InstanceHandle)

Deallocates the provided instance. Read more
source§

unsafe fn allocate_memories( &self, request: &mut InstanceAllocationRequest<'_>, memories: &mut PrimaryMap<DefinedMemoryIndex, (MemoryAllocationIndex, Memory)> ) -> Result<()>

Allocate the memories for the given instance allocation request, pushing them into memories. Read more
source§

unsafe fn deallocate_memories( &self, memories: &mut PrimaryMap<DefinedMemoryIndex, (MemoryAllocationIndex, Memory)> )

Deallocate all the memories in the given primary map. Read more
source§

unsafe fn allocate_tables( &self, request: &mut InstanceAllocationRequest<'_>, tables: &mut PrimaryMap<DefinedTableIndex, (TableAllocationIndex, Table)> ) -> Result<()>

Allocate tables for the given instance allocation request, pushing them into tables. Read more
source§

unsafe fn deallocate_tables( &self, tables: &mut PrimaryMap<DefinedTableIndex, (TableAllocationIndex, Table)> )

Deallocate all the tables in the given primary map. Read more
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,

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.