xiaoxiang781216 commented on a change in pull request #1369: URL: https://github.com/apache/incubator-nuttx/pull/1369#discussion_r452771350
########## File path: arch/arm/src/arm/arm_initialstate.c ########## @@ -52,13 +52,7 @@ * Pre-processor Definitions ****************************************************************************/ -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ +#define IDLETHREAD_STACKMARGIN 128 Review comment: > When the stack to be colored is the stack you are running on you can take the address of a last stack var (defined volatile) in the called routine and and treat that as the end of the write. We need add some margin here, because the called functions(arm_stack_color) still consume some stack space. > The oversize guess will not show true penetration. It will show running off the end, but you can do that with a guard block. Any value smaller than the final stack consumption is a good margin candidate, 1/4 stack size used in new code is a reasonable value. And you can see only a few chip(13) implement the idle stack coloring, but this patch make all chipset get this feature. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org