diff --git a/src/interpreter/env.rs b/src/interpreter/env.rs index d9ca633..b1f98de 100644 --- a/src/interpreter/env.rs +++ b/src/interpreter/env.rs @@ -12,8 +12,10 @@ use interpreter::table::TableInstance; use interpreter::value::RuntimeValue; use interpreter::variable::{VariableInstance, VariableType}; -/// Memory address, at which stack begins. +/// Memory address, at which stack base begins. const DEFAULT_STACK_BASE: u32 = 0; +/// Memory address, at which stack begins. +const DEFAULT_STACK_TOP: u32 = 256 * 1024; /// Memory, allocated for stack. const DEFAULT_TOTAL_STACK: u32 = 5 * 1024 * 1024; /// Total memory, allocated by default. @@ -78,6 +80,8 @@ pub struct EnvParams { pub allow_memory_growth: bool, /// Table size. pub table_size: u32, + /// Static reserve, if any + pub static_size: Option, } pub struct EnvModuleInstance { @@ -188,22 +192,31 @@ pub fn env_module(params: EnvParams) -> Result