lua-users home
lua-l archive

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


> 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