Use MemFdSlot in the on-demand allocator as well.
This commit is contained in:
@@ -6,7 +6,9 @@ use anyhow::{anyhow, Result};
|
||||
use std::convert::TryFrom;
|
||||
use std::sync::Arc;
|
||||
use wasmtime_environ::{EntityIndex, MemoryPlan, MemoryStyle, Module, WASM_PAGE_SIZE};
|
||||
use wasmtime_runtime::{RuntimeLinearMemory, RuntimeMemoryCreator, VMMemoryDefinition};
|
||||
use wasmtime_runtime::{
|
||||
MemoryMemFd, RuntimeLinearMemory, RuntimeMemoryCreator, VMMemoryDefinition,
|
||||
};
|
||||
|
||||
pub fn create_memory(store: &mut StoreOpaque, memory: &MemoryType) -> Result<InstanceId> {
|
||||
let mut module = Module::new();
|
||||
@@ -46,6 +48,10 @@ impl RuntimeLinearMemory for LinearMemoryProxy {
|
||||
current_length: self.mem.byte_size(),
|
||||
}
|
||||
}
|
||||
|
||||
fn needs_init(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -57,6 +63,7 @@ impl RuntimeMemoryCreator for MemoryCreatorProxy {
|
||||
plan: &MemoryPlan,
|
||||
minimum: usize,
|
||||
maximum: Option<usize>,
|
||||
_: Option<&Arc<MemoryMemFd>>,
|
||||
) -> Result<Box<dyn RuntimeLinearMemory>> {
|
||||
let ty = MemoryType::from_wasmtime_memory(&plan.memory);
|
||||
let reserved_size_in_bytes = match plan.style {
|
||||
|
||||
Reference in New Issue
Block a user