This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 70108ae59 wamr: bump the default stack guard size
70108ae59 is described below

commit 70108ae59e7feb4fd48cfd91caa5dce65e7006cd
Author: YAMAMOTO Takashi <yamam...@midokura.com>
AuthorDate: Mon Dec 25 16:14:15 2023 +0900

    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 https://github.com/apache/nuttx-apps/pull/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
---
 interpreters/wamr/Kconfig | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/interpreters/wamr/Kconfig b/interpreters/wamr/Kconfig
index 78dd60361..acf71c7a2 100644
--- a/interpreters/wamr/Kconfig
+++ b/interpreters/wamr/Kconfig
@@ -119,10 +119,18 @@ config INTERPRETERS_WAMR_TAIL_CALL
 
 config INTERPRETERS_WAMR_STACK_GUARD_SIZE
        int "Custom stack guard size"
-       default 0
+       default 1024
        ---help---
-               Reserve some space in stack as guard to detect stack overflow,
-               use stack base by default but may not safe enough.
+               Reserve some space in stack as guard to detect stack overflow.
+
+               Please consider this extra stack consumption when deciding the 
stack
+               size of your NuttX task on which you run WAMR.
+
+               The default value here (1024) was chosen to match the default 
value on
+               the majority of other platforms, including Linux. It also 
matches
+               the expections in the WAMR AoT compiler.
+               On the other hand, it might be a bit larger than what's strictly
+               necessary, especially for typical NuttX targets.
 
 config INTERPRETERS_WAMR_THREAD_MGR
        bool "Enable thread manager"

Reply via email to