mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-23 13:41:32 +00:00
Add Pages and Bytes newtypes
This commit is contained in:
@ -13,8 +13,6 @@ use wasmer_runtime_core::{
|
||||
vm,
|
||||
};
|
||||
|
||||
const WASM_PAGE_SIZE: usize = 65_536;
|
||||
|
||||
pub struct FuncEnv<'env, 'module, 'isa> {
|
||||
env: &'env ModuleEnv<'module, 'isa>,
|
||||
}
|
||||
@ -219,7 +217,7 @@ impl<'env, 'module, 'isa> FuncEnvironment for FuncEnv<'env, 'module, 'isa> {
|
||||
|
||||
func.create_heap(ir::HeapData {
|
||||
base: local_memory_base,
|
||||
min_size: ((description.minimum as u64) * (WASM_PAGE_SIZE as u64)).into(),
|
||||
min_size: (description.minimum.bytes().0 as u64).into(),
|
||||
offset_guard_size: mem_type.guard_size().into(),
|
||||
style: ir::HeapStyle::Dynamic {
|
||||
bound_gv: local_memory_bound,
|
||||
@ -230,7 +228,7 @@ impl<'env, 'module, 'isa> FuncEnvironment for FuncEnv<'env, 'module, 'isa> {
|
||||
mem_type @ MemoryType::Static | mem_type @ MemoryType::SharedStatic => func
|
||||
.create_heap(ir::HeapData {
|
||||
base: local_memory_base,
|
||||
min_size: ((description.minimum as u64) * (WASM_PAGE_SIZE as u64)).into(),
|
||||
min_size: (description.minimum.bytes().0 as u64).into(),
|
||||
offset_guard_size: mem_type.guard_size().into(),
|
||||
style: ir::HeapStyle::Static {
|
||||
bound: mem_type.bounds().unwrap().into(),
|
||||
|
Reference in New Issue
Block a user