diff --git a/ext/bytebox/include/bytebox.h b/ext/bytebox/include/bytebox.h index b3e6309..dedf466 100644 --- a/ext/bytebox/include/bytebox.h +++ b/ext/bytebox/include/bytebox.h @@ -77,6 +77,7 @@ struct bb_module_instance_instantiate_opts bb_wasm_memory_free* free_callback; void* userdata; } wasm_memory_config; + size_t stack_size; bool enable_debug; }; typedef struct bb_module_instance_instantiate_opts bb_module_instance_instantiate_opts; diff --git a/src/main.c b/src/main.c index 6706276..8a6a95b 100644 --- a/src/main.c +++ b/src/main.c @@ -379,8 +379,6 @@ i32 orca_runloop(void* user) return quit_on_wasm_init_failure("wasm decode", wasm_init_err); } - // TODO [ReubenD] - allow specifying stack size - // u32 stackSize = 65536; // app->runtime.m3Env = m3_NewEnvironment(); @@ -428,12 +426,14 @@ i32 orca_runloop(void* user) bb_module_instance_instantiate_opts module_inst_instantiate_opts = { .packages = &module_imports, .num_packages = 1, + .stack_size = 1024 * 64, .enable_debug = false, .wasm_memory_config = { .resize_callback = wasm_memory_resize_callback, .free_callback = wasm_memory_free_callback, .userdata = &app->runtime.wasmMemory, }, + }; wasm_init_err = bb_module_instance_instantiate(app->runtime.bbModuleInst, module_inst_instantiate_opts);