Skip to content

Commit 906cf84

Browse files
committed
Move GetModuleinstanceCommon to wasm_runtime_common.h.
1 parent 3bde82d commit 906cf84

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

core/iwasm/common/wasm_runtime_common.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8103,3 +8103,18 @@ wasm_runtime_check_and_update_last_used_shared_heap(
81038103
return false;
81048104
}
81058105
#endif
8106+
8107+
WASMModuleInstanceExtraCommon *
8108+
GetModuleinstanceCommon(WASMModuleInstance *module_inst)
8109+
{
8110+
#if WASM_ENABLE_AOT != 0
8111+
if (module_inst->module_type == Wasm_Module_AoT) {
8112+
return &((AOTModuleInstanceExtra *)module_inst->e)->common;
8113+
}
8114+
else {
8115+
return &module_inst->e->common;
8116+
}
8117+
#else
8118+
return &module_inst->e->common;
8119+
#endif
8120+
}

core/iwasm/common/wasm_runtime_common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,9 @@ wasm_runtime_check_and_update_last_used_shared_heap(
14271427
uint8 **shared_heap_base_addr_adj_p, bool is_memory64);
14281428
#endif
14291429

1430+
struct WASMModuleInstanceExtraCommon*
1431+
GetModuleinstanceCommon(struct WASMModuleInstance *module_inst);
1432+
14301433
#ifdef __cplusplus
14311434
}
14321435
#endif

core/iwasm/libraries/thread-mgr/thread_manager.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,21 +1530,6 @@ wasm_cluster_is_thread_terminated(WASMExecEnv *exec_env)
15301530
return is_thread_terminated;
15311531
}
15321532

1533-
static WASMModuleInstanceExtraCommon *
1534-
GetModuleinstanceCommon(WASMModuleInstance *module_inst)
1535-
{
1536-
#if WASM_ENABLE_AOT != 0
1537-
if (module_inst->module_type == Wasm_Module_AoT) {
1538-
return &((AOTModuleInstanceExtra *)module_inst->e)->common;
1539-
}
1540-
else {
1541-
return &module_inst->e->common;
1542-
}
1543-
#else
1544-
return &module_inst->e->common;
1545-
#endif
1546-
}
1547-
15481533
void
15491534
exception_lock(WASMModuleInstance *module_inst)
15501535
{

0 commit comments

Comments
 (0)