pub struct OnDemandInstanceAllocator { /* private fields */ }
Expand description
Represents the on-demand instance allocator.
Implementations§
Trait Implementations§
source§impl Clone for OnDemandInstanceAllocator
impl Clone for OnDemandInstanceAllocator
source§fn clone(&self) -> OnDemandInstanceAllocator
fn clone(&self) -> OnDemandInstanceAllocator
Returns a copy 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 Default for OnDemandInstanceAllocator
impl Default for OnDemandInstanceAllocator
source§impl InstanceAllocatorImpl for OnDemandInstanceAllocator
impl InstanceAllocatorImpl for OnDemandInstanceAllocator
source§fn validate_module_impl(
&self,
_module: &Module,
_offsets: &VMOffsets<HostPtr>
) -> Result<()>
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<()>
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)
fn decrement_component_instance_count(&self)
The dual of
increment_component_instance_count
.source§fn increment_core_instance_count(&self) -> Result<()>
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)
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)>
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
)
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)>
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
)
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)
fn purge_module(&self, _: CompiledModuleId)
Purges all lingering resources related to
module
from within this
allocator. Read moresource§fn next_available_pkey(&self) -> Option<ProtectionKey>
fn next_available_pkey(&self) -> Option<ProtectionKey>
Use the next available protection key. Read more
source§fn restrict_to_pkey(&self, _: ProtectionKey)
fn restrict_to_pkey(&self, _: ProtectionKey)
Restrict access to memory regions protected by
pkey
. Read moresource§fn allow_all_pkeys(&self)
fn allow_all_pkeys(&self)
Allow access to memory regions protected by any protection key.
Auto Trait Implementations§
impl Freeze for OnDemandInstanceAllocator
impl !RefUnwindSafe for OnDemandInstanceAllocator
impl Send for OnDemandInstanceAllocator
impl Sync for OnDemandInstanceAllocator
impl Unpin for OnDemandInstanceAllocator
impl !UnwindSafe for OnDemandInstanceAllocator
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> InstanceAllocator for Twhere
T: InstanceAllocatorImpl,
impl<T> InstanceAllocator for Twhere
T: InstanceAllocatorImpl,
source§fn validate_module(
&self,
module: &Module,
offsets: &VMOffsets<HostPtr>
) -> Result<()>
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>
unsafe fn allocate_module( &self, request: InstanceAllocationRequest<'_> ) -> Result<InstanceHandle>
source§unsafe fn deallocate_module(&self, handle: &mut InstanceHandle)
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<()>
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 moresource§unsafe fn deallocate_memories(
&self,
memories: &mut PrimaryMap<DefinedMemoryIndex, (MemoryAllocationIndex, Memory)>
)
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<()>
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 moresource§unsafe fn deallocate_tables(
&self,
tables: &mut PrimaryMap<DefinedTableIndex, (TableAllocationIndex, Table)>
)
unsafe fn deallocate_tables( &self, tables: &mut PrimaryMap<DefinedTableIndex, (TableAllocationIndex, Table)> )
Deallocate all the tables in the given primary map. Read more