Skip to content

Commit 857e6b7

Browse files
author
Georgii Rylov
committed
formatting
1 parent 188eb1c commit 857e6b7

File tree

6 files changed

+18
-22
lines changed

6 files changed

+18
-22
lines changed

core/iwasm/aot/aot_runtime.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,7 @@ aot_create_call_stack(struct WASMExecEnv *exec_env);
780780
#if WAMR_ENABLE_COPY_CALLSTACK != 0
781781
uint32
782782
aot_copy_callstack(WASMExecEnv *exec_env, wasm_frame_ptr_t buffer,
783-
const uint32 length,
784-
const uint32 skip_n);
783+
const uint32 length, const uint32 skip_n);
785784
#endif // WAMR_ENABLE_COPY_CALLSTACK
786785

787786
/**

core/iwasm/common/wasm_runtime_common.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,8 +1743,7 @@ wasm_runtime_destroy_exec_env(WASMExecEnv *exec_env)
17431743
#if WAMR_ENABLE_COPY_CALLSTACK != 0
17441744
uint32
17451745
wasm_copy_callstack(const wasm_exec_env_t exec_env, wasm_frame_ptr_t buffer,
1746-
const uint32 length,
1747-
const uint32 skip_n)
1746+
const uint32 length, const uint32 skip_n)
17481747
{
17491748
/*
17501749
* Note for devs: please refrain from such modifications inside of

core/iwasm/common/wasm_runtime_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ wasm_runtime_destroy_exec_env(WASMExecEnv *exec_env);
642642
#if WAMR_ENABLE_COPY_CALLSTACK != 0
643643
WASM_RUNTIME_API_EXTERN uint32_t
644644
wasm_copy_callstack(const wasm_exec_env_t exec_env, wasm_frame_ptr_t buffer,
645-
const uint32 length, const uint32 skip_n);
645+
const uint32 length, const uint32 skip_n);
646646
#endif // WAMR_ENABLE_COPY_CALLSTACK
647647

648648
/* See wasm_export.h for description */

core/iwasm/include/wasm_export.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ typedef WASMFunctionInstanceCommon *wasm_function_inst_t;
126126
struct WASMMemoryInstance;
127127
typedef struct WASMMemoryInstance *wasm_memory_inst_t;
128128

129-
130129
typedef struct wasm_frame_t {
131130
/* wasm_instance_t */
132131
void *instance;
@@ -880,7 +879,6 @@ wasm_runtime_create_exec_env(wasm_module_inst_t module_inst,
880879
WASM_RUNTIME_API_EXTERN void
881880
wasm_runtime_destroy_exec_env(wasm_exec_env_t exec_env);
882881

883-
884882
/**
885883
* @brief Copy callstack frames.
886884
*
@@ -898,15 +896,16 @@ wasm_runtime_destroy_exec_env(wasm_exec_env_t exec_env);
898896
* - exec_env->module_inst->module
899897
*
900898
* @param exec_env the execution environment that containes frames
901-
* @param buffer the buffer of size equal length * sizeof(frame) to copy frames to
899+
* @param buffer the buffer of size equal length * sizeof(frame) to copy frames
900+
* to
902901
* @param length the number of frames to copy
903902
* @param skip_n the number of frames to skip from the top of the stack
904903
*
905904
* @return number of copied frames
906905
*/
907906
WASM_RUNTIME_API_EXTERN uint32_t
908907
wasm_copy_callstack(const wasm_exec_env_t exec_env, wasm_frame_ptr_t buffer,
909-
const uint32_t length, const uint32_t skip_n);
908+
const uint32_t length, const uint32_t skip_n);
910909

911910
/**
912911
* Get the singleton execution environment for the instance.

core/iwasm/interpreter/wasm_runtime.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4196,21 +4196,20 @@ wasm_get_module_inst_mem_consumption(const WASMModuleInstance *module_inst,
41964196
#endif /* end of (WASM_ENABLE_MEMORY_PROFILING != 0) \
41974197
|| (WASM_ENABLE_MEMORY_TRACING != 0) */
41984198

4199-
42004199
#if WAMR_ENABLE_COPY_CALLSTACK != 0
42014200
uint32
42024201
wasm_interp_copy_callstack(WASMExecEnv *exec_env, wasm_frame_ptr_t buffer,
4203-
uint32 length, uint32 skip_n)
4202+
uint32 length, uint32 skip_n)
42044203
{
42054204
/*
4206-
* Note for devs: please refrain from such modifications inside of
4207-
* wasm_interp_copy_callstack
4208-
* - any allocations/freeing memory
4209-
* - dereferencing any pointers other than: exec_env, exec_env->module_inst,
4210-
* exec_env->module_inst->module, pointers between stack's bottom and
4211-
* top_boundary For more details check wasm_copy_callstack in
4212-
* wasm_export.h
4213-
*/
4205+
* Note for devs: please refrain from such modifications inside of
4206+
* wasm_interp_copy_callstack
4207+
* - any allocations/freeing memory
4208+
* - dereferencing any pointers other than: exec_env, exec_env->module_inst,
4209+
* exec_env->module_inst->module, pointers between stack's bottom and
4210+
* top_boundary For more details check wasm_copy_callstack in
4211+
* wasm_export.h
4212+
*/
42144213
WASMModuleInstance *module_inst =
42154214
(WASMModuleInstance *)wasm_exec_env_get_module_inst(exec_env);
42164215
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,
42214220

42224221
WASMCApiFrame record_frame;
42234222
while (cur_frame && (uint8_t *)cur_frame >= bottom
4224-
&& (uint8_t *)cur_frame + sizeof(WASMInterpFrame) <= top_boundary
4225-
&& count < (skip_n + length)) {
4223+
&& (uint8_t *)cur_frame + sizeof(WASMInterpFrame) <= top_boundary
4224+
&& count < (skip_n + length)) {
42264225
if (!cur_frame->function) {
42274226
cur_frame = cur_frame->prev_frame;
42284227
continue;

core/iwasm/interpreter/wasm_runtime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ wasm_get_table_inst(const WASMModuleInstance *module_inst, uint32 tbl_idx)
734734
#if WAMR_ENABLE_COPY_CALLSTACK != 0
735735
uint32
736736
wasm_interp_copy_callstack(WASMExecEnv *exec_env, wasm_frame_ptr_t buffer,
737-
uint32 length, uint32 skip_n);
737+
uint32 length, uint32 skip_n);
738738
#endif // WAMR_ENABLE_COPY_CALLSTACK
739739

740740
bool

0 commit comments

Comments
 (0)