Skip to content

Conversation

@xujuntwt95329
Copy link
Collaborator

No description provided.

p = func->code;
func->code_compiled = loader_ctx->p_code_compiled;
func->code_compiled_size = loader_ctx->code_compiled_size;
func->code_compiled_size = loader_ctx->code_compiled_peak_size;
Copy link
Collaborator

@wenyongh wenyongh Aug 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func->code_compiled_size is used by wasm_runtime wasm_get_func_code_end() function, which might impact the frame_ip_end in wasm_interp_fast.c and the interpreter's behavior? Do we need to change it here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I modified it back, but the shortcoming is the memory profiler may not be so accurate

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, no need to be so accurate for memory profiler, this almost doesn't occur except few few case.

@wenyongh wenyongh merged commit 3b641b1 into bytecodealliance:main Aug 15, 2022
loganek pushed a commit to loganek/wasm-micro-runtime that referenced this pull request Aug 31, 2022
…alliance#1382)

Reserve one pointer size for fast-interp code_compiled_size: if the last opcode of
current function is to be dropped (e.g. OP_DROP), the peak memory usage will
be larger than the final code_compiled_size, we record the peak size to ensure
there won't be invalid memory access during the second traversing.
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…alliance#1382)

Reserve one pointer size for fast-interp code_compiled_size: if the last opcode of
current function is to be dropped (e.g. OP_DROP), the peak memory usage will
be larger than the final code_compiled_size, we record the peak size to ensure
there won't be invalid memory access during the second traversing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants