Copy read only API behind a flag instead of using user defined callback
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include "bh_common.h"
|
||||
#include "bh_assert.h"
|
||||
#include "bh_log.h"
|
||||
#include "platform_common.h"
|
||||
#include "wasm_export.h"
|
||||
#include "wasm_native.h"
|
||||
#include "wasm_runtime_common.h"
|
||||
@ -1741,18 +1742,19 @@ wasm_runtime_destroy_exec_env(WASMExecEnv *exec_env)
|
||||
wasm_exec_env_destroy(exec_env);
|
||||
}
|
||||
|
||||
void
|
||||
wasm_iterate_callstack(const wasm_exec_env_t exec_env,
|
||||
const wasm_frame_callback frame_callback,
|
||||
void *user_data)
|
||||
#if WAMR_ENABLE_COPY_CALLSTACK != 0
|
||||
uint32
|
||||
wasm_copy_callstack(const wasm_exec_env_t exec_env, wasm_frame_ptr_t buffer,
|
||||
const uint32 length,
|
||||
const uint32 skip_n)
|
||||
{
|
||||
/*
|
||||
* Note for devs: please refrain from such modifications inside of
|
||||
* wasm_iterate_callstack to preserve async-signal-safety
|
||||
* wasm_copy_callstack to preserve async-signal-safety
|
||||
* - any allocations/freeing memory
|
||||
* - dereferencing any pointers other than: exec_env, exec_env->module_inst,
|
||||
* exec_env->module_inst->module, pointers between stack's bottom and
|
||||
* top_boundary For more details check wasm_iterate_callstack in
|
||||
* top_boundary For more details check wasm_copy_callstack in
|
||||
* wasm_export.h
|
||||
*/
|
||||
#if WASM_ENABLE_DUMP_CALL_STACK
|
||||
@ -1761,17 +1763,18 @@ wasm_iterate_callstack(const wasm_exec_env_t exec_env,
|
||||
|
||||
#if WASM_ENABLE_INTERP != 0
|
||||
if (module_inst->module_type == Wasm_Module_Bytecode) {
|
||||
wasm_interp_iterate_callstack(exec_env, frame_callback, user_data);
|
||||
return wasm_interp_copy_callstack(exec_env, buffer, length, skip_n);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_AOT != 0
|
||||
if (module_inst->module_type == Wasm_Module_AoT) {
|
||||
aot_iterate_callstack(exec_env, frame_callback, user_data);
|
||||
return aot_copy_callstack(exec_env, buffer, length, skip_n);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif // WAMR_ENABLE_COPY_CALLSTACK
|
||||
|
||||
bool
|
||||
wasm_runtime_init_thread_env(void)
|
||||
|
||||
Reference in New Issue
Block a user