lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Apr 27, 2015 at 5:55 PM, Coda Highland <chighland@gmail.com> wrote:
> 200 local variables is the limit, so use one less and LuaJIT will NOT throw
> the error.

If you take a local off, you've freed up a stack slot, and you have to
add another set of braces to the table in order to continue to trigger
the error -- my code is a minimal case;

Yes, now I see that.

 
You've ignored all of my suggestions on how to address the issue.

My issue is not "how to workaround", but "how to predict that it may happen".

 
Visual
Studio imposes a 1MB limit on the size of a stack frame, and it's
entirely possible for automatically-generated code to hit this, and
the workaround if you don't want to change how your code works is to
increase that limit with a compiler option. As another example, the
C++ language specification provides a guideline of a limit of 256
levels of nesting and a limit of 1024 local variables.
 
These examples are quite natural: 1MB stack, 256 levels, 1024 local variables.
But I don't understand why Lua is summing
(number of local variables) + (height of matrix) + (width of matrix)
Is this sum always limited by MAXSTACK (which is 250 by default) ?
Does it mean that a matrix 200x200 is impossible?

Can you give a clear definition of strange limitation I've stumbled upon?

--Egor