lua-users home
lua-l archive

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


> A weak-keyed table will prevent a pair from being collected if the
> value contains the only strong reference to the key.

Do you have real examples where that happen? A nice improvement on Lua
would be to make weak tables collect such cyclic references (an idea
first proposted by Rici in the context of Lua), but the implementation
is not easy. It would help to know how frequent the problem is in real
applications.


> The array should be accessible given only a pointer to the userdata
> [...]
> Everything is fine as long as a pointer to a userdata is never stored
> without a corresponding reference in the array part.

If you have the reference, why do you need access to the array with the
pointer? Why can't you use the reference?

-- Roberto