[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Private data
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 3 Oct 2001 21:50:44 -0300
>Two people suggesting using the registry??? You guys scare me! :-) If I
I meant the Lua registry, not the Windows registry, as you have discovered.
I'm sorry about the confusion.
Just to be clear, the Lua registry is an ordinary Lua table that is available
for clients to use as they wish. For instance, libraries might store "global"
information there. See ldblib.c for an example.
The registry was introduced in 4.0 because clients (and the core) could no
longer store Lua information in static C variables, because multiple states
were now possible.
>And add
> void * pprivatedata;
>to the struct lua_State.
If you really want to do this, then 4.1 is ready for it: simply #define a
suitable string for LUA_USERSTATE. See lstate.h.
--lhf