diff --git a/crates/runtime/src/instance.rs b/crates/runtime/src/instance.rs index 835c4457c184..0ba72863e62f 100644 --- a/crates/runtime/src/instance.rs +++ b/crates/runtime/src/instance.rs @@ -22,9 +22,7 @@ use std::convert::TryFrom; use std::ptr::NonNull; use std::sync::Arc; use std::{mem, ptr, slice}; -use wasmtime_environ::entity::{ - packed_option::ReservedValue, BoxedSlice, EntityRef, EntitySet, PrimaryMap, -}; +use wasmtime_environ::entity::{packed_option::ReservedValue, EntityRef, EntitySet, PrimaryMap}; use wasmtime_environ::wasm::{ DataIndex, DefinedGlobalIndex, DefinedMemoryIndex, DefinedTableIndex, ElemIndex, EntityIndex, FuncIndex, GlobalIndex, InstanceIndex, MemoryIndex, ModuleIndex, TableElementType, TableIndex, @@ -47,10 +45,10 @@ pub(crate) struct Instance { offsets: VMOffsets, /// WebAssembly linear memory data. - memories: BoxedSlice>, + memories: PrimaryMap>, /// WebAssembly table data. - tables: BoxedSlice, + tables: PrimaryMap, /// Instances our module defined and their handles. instances: PrimaryMap, diff --git a/crates/runtime/src/instance/allocator.rs b/crates/runtime/src/instance/allocator.rs index 98b0e26dc2f4..6e56780d36ea 100644 --- a/crates/runtime/src/instance/allocator.rs +++ b/crates/runtime/src/instance/allocator.rs @@ -17,9 +17,7 @@ use std::ptr::{self, NonNull}; use std::slice; use std::sync::Arc; use thiserror::Error; -use wasmtime_environ::entity::{ - packed_option::ReservedValue, BoxedSlice, EntityRef, EntitySet, PrimaryMap, -}; +use wasmtime_environ::entity::{packed_option::ReservedValue, EntityRef, EntitySet, PrimaryMap}; use wasmtime_environ::wasm::{ DefinedFuncIndex, DefinedMemoryIndex, DefinedTableIndex, FuncIndex, GlobalInit, SignatureIndex, TableElementType, WasmType, @@ -285,20 +283,20 @@ impl OnDemandInstanceAllocator { Self { mem_creator } } - fn create_tables(module: &Module) -> BoxedSlice { + fn create_tables(module: &Module) -> PrimaryMap { let num_imports = module.num_imported_tables; let mut tables: PrimaryMap = PrimaryMap::with_capacity(module.table_plans.len() - num_imports); for table in &module.table_plans.values().as_slice()[num_imports..] { tables.push(Table::new_dynamic(table)); } - tables.into_boxed_slice() + tables } fn create_memories( &self, module: &Module, - ) -> Result>, InstantiationError> + ) -> Result>, InstantiationError> { let creator = self .mem_creator @@ -314,7 +312,7 @@ impl OnDemandInstanceAllocator { .map_err(InstantiationError::Resource)?, ); } - Ok(memories.into_boxed_slice()) + Ok(memories) } fn check_table_init_bounds(instance: &Instance) -> Result<(), InstantiationError> {