[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Feature request: more integration of Lua and C memory management
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 11 Jun 2004 11:35:11 -0300
> 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
> 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?