feat: Add instruction metering for interpreter (#4122)

- add instruction metering support with execution limit
- initialize instruction execution limit in exec_env
- docs: add instruction metering section to build_wamr documentation
This commit is contained in:
Alix ANNERAUD
2025-05-26 10:16:42 +02:00
committed by GitHub
parent 6659a312cf
commit c018b8ab98
10 changed files with 104 additions and 3 deletions

View File

@ -2285,6 +2285,15 @@ wasm_runtime_access_exce_check_guard_page()
}
#endif
#if WASM_ENABLE_INSTRUCTION_METERING != 0
void
wasm_runtime_set_instruction_count_limit(WASMExecEnv *exec_env,
int instructions_to_execute)
{
exec_env->instructions_to_execute = instructions_to_execute;
}
#endif
WASMFuncType *
wasm_runtime_get_function_type(const WASMFunctionInstanceCommon *function,
uint32 module_type)