lua-users home
lua-l archive

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


Sean Conner wrote:
>   Lua itself limits a function to around 2^17 or 2^18 constants, so I worked
> around that limit.  Is the 65,536 limit in LuaJIT a bug, or a design
> constaint?

LuaJIT has different limits and different design constraints.

For a single table that consists only of constants there's
effectively no limit (memory is the limit).

But your test case has lots of small, nested tables. Every
individual table only occupies a single constant slot (and not one
for each of its keys/values). But there are too many of these
tables to keep them in a single function.

The short term solution is to split the table construction into
smaller pieces, wrapped into individual functions. The long term
solution would be to add a workaround for these limits to LuaJIT.
But I'm not sure about the best way, yet.

> [2]	The Lua bug it exposed has since been fixed
> 	http://www.lua.org/bugs.html#5.1.4-6

This problem is not present in LuaJIT 2.0.

--Mike