Merge main into dev/socket
This commit is contained in:
@ -341,10 +341,6 @@ wasm_runtime_init()
|
||||
void
|
||||
wasm_runtime_destroy()
|
||||
{
|
||||
#if WASM_ENABLE_FAST_JIT != 0
|
||||
jit_compiler_destroy();
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_REF_TYPES != 0
|
||||
wasm_externref_map_destroy();
|
||||
#endif
|
||||
@ -368,6 +364,14 @@ wasm_runtime_destroy()
|
||||
os_mutex_destroy(®istered_module_list_lock);
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_FAST_JIT != 0
|
||||
/* Destroy Fast-JIT compiler after destroying the modules
|
||||
* loaded by multi-module feature, since the Fast JIT's
|
||||
* code cache allocator may be used by these modules.
|
||||
*/
|
||||
jit_compiler_destroy();
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_SHARED_MEMORY
|
||||
wasm_shared_memory_destroy();
|
||||
#endif
|
||||
@ -404,7 +408,6 @@ wasm_runtime_full_init(RuntimeInitArgs *init_args)
|
||||
#if WASM_ENABLE_DEBUG_INTERP != 0
|
||||
if (strlen(init_args->ip_addr))
|
||||
if (!wasm_debug_engine_init(init_args->ip_addr,
|
||||
init_args->platform_port,
|
||||
init_args->instance_port)) {
|
||||
wasm_runtime_destroy();
|
||||
return false;
|
||||
@ -504,7 +507,7 @@ wasm_runtime_is_xip_file(const uint8 *buf, uint32 size)
|
||||
|
||||
#if (WASM_ENABLE_THREAD_MGR != 0) && (WASM_ENABLE_DEBUG_INTERP != 0)
|
||||
uint32
|
||||
wasm_runtime_start_debug_instance(WASMExecEnv *exec_env)
|
||||
wasm_runtime_start_debug_instance_with_port(WASMExecEnv *exec_env, int32_t port)
|
||||
{
|
||||
WASMModuleInstanceCommon *module_inst =
|
||||
wasm_runtime_get_module_inst(exec_env);
|
||||
@ -522,12 +525,18 @@ wasm_runtime_start_debug_instance(WASMExecEnv *exec_env)
|
||||
return cluster->debug_inst->control_thread->port;
|
||||
}
|
||||
|
||||
if (wasm_debug_instance_create(cluster)) {
|
||||
if (wasm_debug_instance_create(cluster, port)) {
|
||||
return cluster->debug_inst->control_thread->port;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32
|
||||
wasm_runtime_start_debug_instance(WASMExecEnv *exec_env)
|
||||
{
|
||||
return wasm_runtime_start_debug_instance_with_port(exec_env, -1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_MULTI_MODULE != 0
|
||||
|
||||
Reference in New Issue
Block a user