On 14.07.2017 19:20, Erich Steinböck wrote:
>
>     getStackBase() may return different values if executed multiple times 
> creating side-effects
>
> Rony, stackBase is checked by CALL's or method invocations to limit recursion 
> depth (thus breaking
> any infinite recursion).
> In such cases you'd receive Error 11 "Control stack full"
Thank you for this insight! Could see that getStackBase() is also defined and 
used in SysActivity
using PlatformDefinitions.h where the stack size is defined to be half a 
megabyte (1024*512).

For consistency, shouldn't this definition be used in 
common/platform/unix/SysThread.hpp and
common/platform/windows/SysThread.hpp (defining THREAD_STACK_SIZE) as well?

> The compiler warning is to be expected as it is usually not a good idea to 
> return the address of a
> local (i. e. stack) variable.  It's OK how ooRexx uses it in this case.
Yes. There are articles about this technique to get the top of the stack, eg. 
the first answer to
<https://stackoverflow.com/questions/1847053/how-to-get-address-of-base-stack-pointer>.

---rony

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to