Add a type parameter to VMOffsets for pointer size (#3020)
* Add a type parameter to `VMOffsets` for pointer size This commit adds a type parameter to `VMOffsets` representing the pointer size to improve computations in `wasmtime-runtime` which always use a constant value of the host's pointer size. The type parameter is `u8` for `wasmtime-cranelift`'s use case where cross-compilation may be involved. * fix lightbeam
This commit is contained in:
@@ -22,8 +22,8 @@ use wasmtime_environ::wasm::{
|
||||
DefinedFuncIndex, DefinedMemoryIndex, DefinedTableIndex, GlobalInit, SignatureIndex, WasmType,
|
||||
};
|
||||
use wasmtime_environ::{
|
||||
ir, MemoryInitialization, MemoryInitializer, Module, ModuleType, TableInitializer, VMOffsets,
|
||||
WASM_PAGE_SIZE,
|
||||
ir, HostPtr, MemoryInitialization, MemoryInitializer, Module, ModuleType, TableInitializer,
|
||||
VMOffsets, WASM_PAGE_SIZE,
|
||||
};
|
||||
|
||||
mod pooling;
|
||||
@@ -643,7 +643,7 @@ unsafe impl InstanceAllocator for OnDemandInstanceAllocator {
|
||||
let mut handle = {
|
||||
let instance = Instance {
|
||||
module: req.module.clone(),
|
||||
offsets: VMOffsets::new(std::mem::size_of::<*const u8>() as u8, &req.module),
|
||||
offsets: VMOffsets::new(HostPtr, &req.module),
|
||||
memories,
|
||||
tables,
|
||||
dropped_elements: EntitySet::with_capacity(req.module.passive_elements.len()),
|
||||
|
||||
Reference in New Issue
Block a user