Spread module custom data to all threads, enable libc-builtin float print (#633)

This commit is contained in:
Xu Jun
2021-05-19 14:57:31 +08:00
committed by GitHub
parent a14a4487bb
commit f637438e4e
12 changed files with 88 additions and 11 deletions

View File

@ -1438,8 +1438,8 @@ wasm_runtime_clear_exception(WASMModuleInstanceCommon *module_inst)
}
void
wasm_runtime_set_custom_data(WASMModuleInstanceCommon *module_inst,
void *custom_data)
wasm_runtime_set_custom_data_internal(WASMModuleInstanceCommon *module_inst,
void *custom_data)
{
#if WASM_ENABLE_INTERP != 0
if (module_inst->module_type == Wasm_Module_Bytecode) {
@ -1455,6 +1455,17 @@ wasm_runtime_set_custom_data(WASMModuleInstanceCommon *module_inst,
#endif
}
void
wasm_runtime_set_custom_data(WASMModuleInstanceCommon *module_inst,
void *custom_data)
{
#if WASM_ENABLE_THREAD_MGR != 0
wasm_cluster_spread_custom_data(module_inst, custom_data);
#else
wasm_runtime_set_custom_data_internal(module_inst, custom_data);
#endif
}
void*
wasm_runtime_get_custom_data(WASMModuleInstanceCommon *module_inst)
{