From 6b6e102b241d450288aedbcbfd2c435071631c7e Mon Sep 17 00:00:00 2001 From: NikVolf Date: Sun, 12 Nov 2017 18:58:10 +0300 Subject: [PATCH] default stack top - 256kb, configurable --- src/interpreter/env.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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