Skip to content

Commit 70108ae

Browse files
yamtjerpelea
authored andcommitted
wamr: bump the default stack guard size
using 0 by default seems a bit too aggressive to me. 1024 here is what would have been used before this kconfig knob was introduced by #1259. It also matches some expectations in the recent wamrc. https://github.com/bytecodealliance/wasm-micro-runtime/blob/40b430fd240ad45f5c7a7dd0239fa2425e7c294e/core/iwasm/compilation/aot_emit_aot_file.c#L2672-L2678
1 parent 9c48a8d commit 70108ae

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

interpreters/wamr/Kconfig

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,18 @@ config INTERPRETERS_WAMR_TAIL_CALL
119119

120120
config INTERPRETERS_WAMR_STACK_GUARD_SIZE
121121
int "Custom stack guard size"
122-
default 0
122+
default 1024
123123
---help---
124-
Reserve some space in stack as guard to detect stack overflow,
125-
use stack base by default but may not safe enough.
124+
Reserve some space in stack as guard to detect stack overflow.
125+
126+
Please consider this extra stack consumption when deciding the stack
127+
size of your NuttX task on which you run WAMR.
128+
129+
The default value here (1024) was chosen to match the default value on
130+
the majority of other platforms, including Linux. It also matches
131+
the expections in the WAMR AoT compiler.
132+
On the other hand, it might be a bit larger than what's strictly
133+
necessary, especially for typical NuttX targets.
126134

127135
config INTERPRETERS_WAMR_THREAD_MGR
128136
bool "Enable thread manager"

0 commit comments

Comments
 (0)