lua-users home
lua-l archive

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


Asko Kauppi wrote:


Based on the enum/int32 implementation for Lua, I'm in the need for an extremely fast integer -> metatable lookup on the C side.

Currently, I use 'glua_meta_nn' keys into the registry, but there must be a better way.

Could I, say, have a set of some 1000 :) virtual indices s.a. 'REGISTRYINDEX' all for my own need. I could maintain that range by myself (store table references there, in neat order) as long as it would be sure no-one else is dealing with those 'slots'.

Does Lua already provide this, or could such a range be considered for the future?

-ak


if you are on the c-side, could you use upvalues ?
(push them all at lib init time maybe ?)

is there a limit to the number of upvalues allowed ?

Adrian