lua-users home
lua-l archive

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


Glenn wrote:
> The short short version of my problem is that I have a massive table
> with 100000+ entries (where each entry is a small table with five
> elements), populated in C code, which has then been serialized from a
> Lua script. When I deserialize it I get a 'constant table overflow'
> error.  If I cut the number of entries down to around 55000, no
> error.    

The answer is in the mailing list archive, as often:

http://lua-users.org/lists/lua-l/2007-06/msg00231.html

There is a limit in the number of constants in a single source file set
at 2^18. This limit is not configurable, it's inherent in the format of
the byte code instructions.

The solution is to split your files, or use another file format and load
the data yourself (for example you could use CSV and put one subtable
per line, with a column per element of the subtables).