Change how Instance stores instantiated memories in the runtime.
This commit changes `Instance` such that memories can be stored statically, with just a base pointer, size, maximum, and a callback to make memory accessible. Previously the memories were being stored as boxed trait objects, which would require the pooling allocator to do some unpleasant things to avoid allocations. With this change, the pooling allocator can simply define a memory for the instance without using a trait object.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
use crate::export::Export;
|
||||
use crate::externref::{StackMapRegistry, VMExternRefActivationsTable};
|
||||
use crate::memory::{RuntimeLinearMemory, RuntimeMemoryCreator};
|
||||
use crate::memory::{Memory, RuntimeMemoryCreator};
|
||||
use crate::table::{Table, TableElement};
|
||||
use crate::traphandlers::Trap;
|
||||
use crate::vmcontext::{
|
||||
@@ -51,7 +51,7 @@ pub(crate) struct Instance {
|
||||
offsets: VMOffsets,
|
||||
|
||||
/// WebAssembly linear memory data.
|
||||
memories: PrimaryMap<DefinedMemoryIndex, Box<dyn RuntimeLinearMemory>>,
|
||||
memories: PrimaryMap<DefinedMemoryIndex, Memory>,
|
||||
|
||||
/// WebAssembly table data.
|
||||
tables: PrimaryMap<DefinedTableIndex, Table>,
|
||||
|
||||
Reference in New Issue
Block a user