Refactor runtime Table to support static storage.
This commit refactors `Table` in the runtime such that it can be created from a pointer to existing table data. The current `Vec` backing of the `Table` is considered to be "dynamic" storage. This will be used for the upcoming pooling allocator where table memory is managed externally to the instance. The `table.copy` implementation was improved to use slice primitives for doing the copying. Fixes #983.
This commit is contained in:
@@ -290,7 +290,7 @@ impl OnDemandInstanceAllocator {
|
||||
let mut tables: PrimaryMap<DefinedTableIndex, _> =
|
||||
PrimaryMap::with_capacity(module.table_plans.len() - num_imports);
|
||||
for table in &module.table_plans.values().as_slice()[num_imports..] {
|
||||
tables.push(Table::new(table));
|
||||
tables.push(Table::new_dynamic(table));
|
||||
}
|
||||
tables.into_boxed_slice()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user