Show quoted text 13 lines
Unfortunately the stack checker doesn't know the right size of the stack (yet; due to similar problems I am working on that at atm). It assumes that the stack is of fixed size, stored in the global "stacklen" (or so) variable.
When stack checking is enabled, the compiler generates some extra code in the function prolog which checks whether the current stack pointer, decreased by the amount of stack space this method requires and some safety margin, is below the bottom of the stack (a value calculated at program start from the initial stack pointer, and the "stacklen" contents).
If this is the case, it gives a RTE 202.
Problems with that:
* the __stacklen variable is a predetermined (at compile time) fixed value
* the safety margin is quite high, e.g. 16k, which immediately RTEs in threads, because their default stack size is quite low (<= 16k...).
I hope this answers your question.
Regards,
Thomas
