fix exec_env not checked issue, export __heap_base and __data_end in sample to decrease memory usage (#371)

This commit is contained in:
Xu Jun
2020-09-05 14:48:08 +08:00
committed by GitHub
parent c8df3f6eed
commit 2e0cef3ef1
4 changed files with 17 additions and 15 deletions

View File

@ -84,16 +84,17 @@ WASMExecEnv *
wasm_exec_env_create(struct WASMModuleInstanceCommon *module_inst,
uint32 stack_size)
{
WASMExecEnv *exec_env = wasm_exec_env_create_internal(module_inst,
stack_size);
WASMExecEnv *exec_env =
wasm_exec_env_create_internal(module_inst, stack_size);
if (!exec_env)
return NULL;
/* Set the aux_stack_boundary to 0 */
exec_env->aux_stack_boundary = 0;
#if WASM_ENABLE_THREAD_MGR != 0
WASMCluster *cluster;
if (!exec_env)
return NULL;
/* Create a new cluster for this exec_env */
cluster = wasm_cluster_create(exec_env);
if (!cluster) {