[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Reuse of userdata?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 12 Jan 2004 12:12:37 -0200
> If a userdata has a metatable with a __gc field, I know it gets called
> but does the GC mechanism then still collect the userdata object after
> calling it?
Not immediately, because the __gc method may resurrect it.
> Is the resurrected object eligible for repeat finalization?
No. Each userdata is finalized only once, like in Java. Once finalized,
the next GC cycle that the userdata is garbage then it is immediately
collected.
-- Roberto