lua-users home
lua-l archive

Re: Integer keys in registry

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


On 17 May 2012, at 09:46, Alexandre Rion wrote:
> But when I'm looking to the luaL_ref/luaL_unref source code, I don't find any access to the registry. Where does it come from?
The registry is just a table with index LUA_REGISTRYINDEX, so to store a reference in the registry table use
luaL_ref(l, LUA_REGISTRYINDEX)
This allows you to also use luaL_ref with any other table as well.
Thanks,
Kev

AltStyle によって変換されたページ (->オリジナル) /