Nicolas Cannasse wrote:
Justin Collins a écrit :
Hello all,
I ran into a problem where module.c seems to be failing a stack check
around line 151:
if( stack < istack || stack >= MAX_STACK_PER_FUNCTION - 4 )
In particular, it is the "stack >= MAX_STACK_PER_FUNCTION - 4" which
is true (and apparently bad).
I am guessing this means something like I have too many local
variables inside a function?
Indeed.
You cannot have more than 124 locals inside a given function.
That's already a lot :)
Best,
Nicolas
Okay, granted. However, what about 124 locals at the top-level? That
seems to fail, as well.
As I understand it, local variables are only copied into functions if
they are accessed from those functions. This particular test seems to
assume all local variables may be copied, whether they actually will or
not. Is this correct?
My problem is that I generate a lot of short-lived, temporary variables.
They are not going to be accessed from inside other functions (so there
is no danger of having to copy 100+ variables to the function stack). I
don't want them to be globals, because I want them garbage collected as
soon as possible. What are my options?
Thanks,
Justin
--
Neko : One VM to run them all
(http://nekovm.org)