Make memory profiling show native stack usage (#1917)

This commit is contained in:
YAMAMOTO Takashi
2023-02-01 12:52:15 +09:00
committed by GitHub
parent 0435acdd43
commit 7d3b2a8773
15 changed files with 182 additions and 9 deletions

View File

@ -2074,6 +2074,7 @@ call_wasm_with_hw_bound_check(WASMModuleInstance *module_inst,
/* Check native stack overflow firstly to ensure we have enough
native stack to run the following codes before actually calling
the aot function in invokeNative function. */
RECORD_STACK_USAGE(exec_env, (uint8 *)&exec_env_tls);
if ((uint8 *)&exec_env_tls < exec_env->native_stack_boundary
+ page_size * (guard_page_count + 1)) {
wasm_set_exception(module_inst, "native stack overflow");