Remove unused argument in wasm_runtime_lookup_function and refactor WASMModuleInstance (#3218)

Remove the unused parameter `signature` from `wasm_runtime_lookup_function`.

Refactor the layout of WASMModuleInstance structure:
- move common data members `c_api_func_imports` and `cur_exec_env` from
  `WASMModuleInstanceExtraCommon` to `WASMModuleInstance`
- In `WASMModuleInstance`, enlarge `reserved[3]` to `reserved[5]` in case that
  we need to add more fields in the future

ps.
https://github.com/bytecodealliance/wasm-micro-runtime/issues/2530
https://github.com/bytecodealliance/wasm-micro-runtime/issues/3202
This commit is contained in:
TianlongLiang
2024-03-13 12:28:45 +08:00
committed by GitHub
parent ce44e0ec0c
commit c3e33a96ea
28 changed files with 100 additions and 136 deletions

View File

@ -149,8 +149,7 @@ main(int argc, char *argv_main[])
goto fail;
}
if (!(func = wasm_runtime_lookup_function(module_inst, "generate_float",
NULL))) {
if (!(func = wasm_runtime_lookup_function(module_inst, "generate_float"))) {
printf("The generate_float wasm function is not found.\n");
goto fail;
}
@ -189,8 +188,8 @@ main(int argc, char *argv_main[])
argv2[4] = 3; // the last argument is the digits after decimal point for
// converting float to string
if (!(func2 = wasm_runtime_lookup_function(module_inst, "float_to_string",
NULL))) {
if (!(func2 =
wasm_runtime_lookup_function(module_inst, "float_to_string"))) {
printf(
"The wasm function float_to_string wasm function is not found.\n");
goto fail;
@ -208,7 +207,7 @@ main(int argc, char *argv_main[])
}
wasm_function_inst_t func3 =
wasm_runtime_lookup_function(module_inst, "calculate", NULL);
wasm_runtime_lookup_function(module_inst, "calculate");
if (!func3) {
printf("The wasm function calculate is not found.\n");
goto fail;