formatting

This commit is contained in:
Georgii Rylov 2025-02-26 10:57:50 +00:00
parent 188eb1c941
commit 857e6b73c8
6 changed files with 18 additions and 22 deletions

View File

@ -780,8 +780,7 @@ aot_create_call_stack(struct WASMExecEnv *exec_env);
#if WAMR_ENABLE_COPY_CALLSTACK != 0
uint32
aot_copy_callstack(WASMExecEnv *exec_env, wasm_frame_ptr_t buffer,
const uint32 length,
const uint32 skip_n);
const uint32 length, const uint32 skip_n);
#endif // WAMR_ENABLE_COPY_CALLSTACK
/**

View File

@ -1743,8 +1743,7 @@ wasm_runtime_destroy_exec_env(WASMExecEnv *exec_env)
#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)
const uint32 length, const uint32 skip_n)
{
/*
* Note for devs: please refrain from such modifications inside of

View File

@ -642,7 +642,7 @@ wasm_runtime_destroy_exec_env(WASMExecEnv *exec_env);
#if WAMR_ENABLE_COPY_CALLSTACK != 0
WASM_RUNTIME_API_EXTERN uint32_t
wasm_copy_callstack(const wasm_exec_env_t exec_env, wasm_frame_ptr_t buffer,
const uint32 length, const uint32 skip_n);
const uint32 length, const uint32 skip_n);
#endif // WAMR_ENABLE_COPY_CALLSTACK
/* See wasm_export.h for description */

View File

@ -126,7 +126,6 @@ typedef WASMFunctionInstanceCommon *wasm_function_inst_t;
struct WASMMemoryInstance;
typedef struct WASMMemoryInstance *wasm_memory_inst_t;
typedef struct wasm_frame_t {
/* wasm_instance_t */
void *instance;
@ -880,7 +879,6 @@ wasm_runtime_create_exec_env(wasm_module_inst_t module_inst,
WASM_RUNTIME_API_EXTERN void
wasm_runtime_destroy_exec_env(wasm_exec_env_t exec_env);
/**
* @brief Copy callstack frames.
*
@ -898,7 +896,8 @@ wasm_runtime_destroy_exec_env(wasm_exec_env_t exec_env);
* - exec_env->module_inst->module
*
* @param exec_env the execution environment that containes frames
* @param buffer the buffer of size equal length * sizeof(frame) to copy frames to
* @param buffer the buffer of size equal length * sizeof(frame) to copy frames
* to
* @param length the number of frames to copy
* @param skip_n the number of frames to skip from the top of the stack
*
@ -906,7 +905,7 @@ wasm_runtime_destroy_exec_env(wasm_exec_env_t exec_env);
*/
WASM_RUNTIME_API_EXTERN uint32_t
wasm_copy_callstack(const wasm_exec_env_t exec_env, wasm_frame_ptr_t buffer,
const uint32_t length, const uint32_t skip_n);
const uint32_t length, const uint32_t skip_n);
/**
* Get the singleton execution environment for the instance.

View File

@ -4196,21 +4196,20 @@ wasm_get_module_inst_mem_consumption(const WASMModuleInstance *module_inst,
#endif /* end of (WASM_ENABLE_MEMORY_PROFILING != 0) \
|| (WASM_ENABLE_MEMORY_TRACING != 0) */
#if WAMR_ENABLE_COPY_CALLSTACK != 0
uint32
wasm_interp_copy_callstack(WASMExecEnv *exec_env, wasm_frame_ptr_t buffer,
uint32 length, uint32 skip_n)
uint32 length, uint32 skip_n)
{
/*
* Note for devs: please refrain from such modifications inside of
* wasm_interp_copy_callstack
* - 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_copy_callstack in
* wasm_export.h
*/
* Note for devs: please refrain from such modifications inside of
* wasm_interp_copy_callstack
* - 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_copy_callstack in
* wasm_export.h
*/
WASMModuleInstance *module_inst =
(WASMModuleInstance *)wasm_exec_env_get_module_inst(exec_env);
WASMInterpFrame *cur_frame = wasm_exec_env_get_cur_frame(exec_env);
@ -4221,8 +4220,8 @@ wasm_interp_copy_callstack(WASMExecEnv *exec_env, wasm_frame_ptr_t buffer,
WASMCApiFrame record_frame;
while (cur_frame && (uint8_t *)cur_frame >= bottom
&& (uint8_t *)cur_frame + sizeof(WASMInterpFrame) <= top_boundary
&& count < (skip_n + length)) {
&& (uint8_t *)cur_frame + sizeof(WASMInterpFrame) <= top_boundary
&& count < (skip_n + length)) {
if (!cur_frame->function) {
cur_frame = cur_frame->prev_frame;
continue;

View File

@ -734,7 +734,7 @@ wasm_get_table_inst(const WASMModuleInstance *module_inst, uint32 tbl_idx)
#if WAMR_ENABLE_COPY_CALLSTACK != 0
uint32
wasm_interp_copy_callstack(WASMExecEnv *exec_env, wasm_frame_ptr_t buffer,
uint32 length, uint32 skip_n);
uint32 length, uint32 skip_n);
#endif // WAMR_ENABLE_COPY_CALLSTACK
bool