lua-users home
lua-l archive

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

2009/7/25 David Manura <>:
> As previously discussed [1,2], Lua code does not have a direct manner
> of preallocating space in tables, like in the lua_createtable [3] C
> API function.  The problem and its solutions, including a new solution
> involving Lua bytecode hacking, are now described in
> [1]
> [2]
> [3]

I thought the normal way to do that from Lua was to put nil in a table
constructor (ie. local t = {nil,nil,nil,nil,nil} would be equivalent
to lua_createtable(L, 5, 0)), but that's not mentionned on your page.
I was certain that lhf posted several times about that pseudo-feature,
but now I can't find any of these threads in the mailing list archive,
so I may be wrong.