mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 15:05:19 +00:00
Add a comment on WASM_STACK_GUARD_SIZE (#3332)
This commit is contained in:
parent
ba59e56e19
commit
f6481cedec
|
@ -445,7 +445,29 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Reserved bytes to the native thread stack boundary, throw native
|
/* Reserved bytes to the native thread stack boundary, throw native
|
||||||
stack overflow exception if the guard boudary is reached */
|
* stack overflow exception if the guard boudary is reached
|
||||||
|
*
|
||||||
|
* WASM_STACK_GUARD_SIZE needs to be large enough for:
|
||||||
|
*
|
||||||
|
* - native functions
|
||||||
|
* w/o hw bound check, the overhead (aot_call_function etc) + the native
|
||||||
|
* function itself. as of writing this, the former is about 1000 bytes
|
||||||
|
* on macOS amd64.
|
||||||
|
* with hw bound check, theoretically, only needs to cover the logic to
|
||||||
|
* set up the jmp_buf stack.
|
||||||
|
*
|
||||||
|
* - aot runtime functions
|
||||||
|
* eg. aot_enlarge_memory.
|
||||||
|
*
|
||||||
|
* - w/o hw bound check, the intepreter loop
|
||||||
|
*
|
||||||
|
* - stack check wrapper functions generated by the aot compiler
|
||||||
|
* (--stack-bounds-checks=1)
|
||||||
|
*
|
||||||
|
* Note: on platforms with lazy function binding, don't forget to consider
|
||||||
|
* the symbol resolution overhead on the first call. For example,
|
||||||
|
* on Ubuntu amd64 20.04, it seems to consume about 1500 bytes.
|
||||||
|
*/
|
||||||
#ifndef WASM_STACK_GUARD_SIZE
|
#ifndef WASM_STACK_GUARD_SIZE
|
||||||
#if WASM_ENABLE_UVWASI != 0
|
#if WASM_ENABLE_UVWASI != 0
|
||||||
/* UVWASI requires larger native stack */
|
/* UVWASI requires larger native stack */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user