[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Confused by Lua garbage collection tear down order when there are references between objects
- From: Eric Wing <ewmailing@...>
- Date: Thu, 22 May 2014 20:37:57 -0700
On 5/22/14, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> I think I misunderstand "in the reverse order that they were marked
>> for finalization".
>
> "Marked for finalization" has a special and well-defined meaning
> there. It is explained two paragraphs before the one you misunderstood:
>
> For an object (table or userdata) to be finalized when collected, you
> must mark it for finalization. You mark an object for finalization
> when you set its metatable and the metatable has a field indexed by
> the string __gc.
>
> So, "in the reverse order that they were marked for finalization" means
> in the reverse order that they got a metatable with a __gc field (which,
> more often than not, is just after they were created).
>
> -- Roberto
>
>
Thank you. I now understand.
Thanks,
Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
- References:
- Confused by Lua garbage collection tear down order when there are references between objects, Eric Wing
- Re: Confused by Lua garbage collection tear down order when there are references between objects, Tim Hill
- Re: Confused by Lua garbage collection tear down order when there are references between objects, Philipp Janda
- Re: Confused by Lua garbage collection tear down order when there are references between objects, Tim Hill
- Re: Confused by Lua garbage collection tear down order when there are references between objects, Philipp Janda
- Re: Confused by Lua garbage collection tear down order when there are references between objects, Coda Highland
- Re: Confused by Lua garbage collection tear down order when there are references between objects, Philipp Janda
- Re: Confused by Lua garbage collection tear down order when there are references between objects, Roberto Ierusalimschy
- Re: Confused by Lua garbage collection tear down order when there are references between objects, Eric Wing
- Re: Confused by Lua garbage collection tear down order when there are references between objects, Roberto Ierusalimschy