[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Is this possible? (garbage collect and weak tables)
- From: Ignacio Burgueño <ignaciob@...>
- Date: Fri, 06 Nov 2009 11:37:53 -0200
Mike Pall wrote:
Alex Davies wrote:
I wonder if LuaJit 2.x would incorrectly optimise the temp variable away
=/? I'm guessing not, as the gc only runs in interpreted mode, but still
But you still need to keep the strong reference for semantic
correctness and for the interpreter. And you should copy the
strong reference to the weak reference, not the other way round.
Thanks Alex, Roberto, Mike. I rewrote the code as Roberto suggested. And
Mike's last comment made me aware of my mistake (using the weak
reference throughout the code instead of the strong one).