lua-users home
lua-l archive

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

On Thu, Jun 26, 2003 at 07:51:13PM +0900, Dylan Cuthbert wrote:
> You hit the nail on the head really - pointers are nasty so the light user
> data system seems like a bit of a C old-school hack to me.

Well, I use light userdatas as keys to a weak table in the registry (Lua 
code has no access to it) that is used as a cache for the proxy objects
or "watches" how I like to call them. (These are weak references, but
also have a destroy handler that gets called before the object gets
deinitialised so that code that depends on the object existing can also
deinitialise or find another object to use.)