lua-users home
lua-l archive

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


> dilbert:maze2> mkmz
> before exit, input =maze2-olua.lua
> Active Stack:
>         function dofile [in file (C)]
>         main of mz2-defs.lua

Are you sure this is the whole message? It seems the error message itself
is missing; it should appear just before the "Active Stack:", where
is the "before exit...".


> Is there a limit on the size of files to be used as a
> 'dofile'?  May be it is trying to precompile before
> executing and running out of memory?

If you are using the $debug directive, there is a limit of 64K lines in
each file, because the debugging information is stored in only two bytes:

> arraial:~/prj/lua> /usr/local/bin/lua -d temp
> lua: code too long (limit=64K);
>   last token read: `a' at line 65535 in chunk `temp'

Also, there is a limit in the size of the body of a control structure
(whiles, ifs, ...), because the jump instruction uses only two
bytes. Otherwise, there is no fixed limit. Anyway, there should be an error
message with some hints...

**PS:**
Is the error message the "constant table overflow" of the subject?? (I
noticed it only now). Are you using version 3.1? If yes to both questions,
then the problem is the number of different "constants" in your file
(string literals, real numbers, names of global variables). There is a
limit (again of 64K ;-) to the number of different constants each function
can manipulate. This limit is for functions, not for files; the "main" of a
file counts as one function. You can try spliting your "main" in some
functions to avoid this limit.

-- Roberto