Use pre-created exec_env for instantiation and module_malloc/free (#2047)

Use pre-created exec_env for instantiation and module_malloc/free,
use the same exec_env of the current thread to avoid potential
unexpected behavior.

And remove unnecessary shared_mem_lock in wasm_module_free,
which may cause dead lock.
This commit is contained in:
Wenyong Huang
2023-03-23 19:19:47 +08:00
committed by GitHub
parent 4c2d358980
commit 3977f0b22a
10 changed files with 327 additions and 236 deletions

View File

@ -581,7 +581,7 @@ pthread_create_wrapper(wasm_exec_env_t exec_env,
#endif
if (!(new_module_inst = wasm_runtime_instantiate_internal(
module, true, stack_size, 0, NULL, 0)))
module, true, exec_env, stack_size, 0, NULL, 0)))
return -1;
/* Set custom_data to new module instance */