lua-users home
lua-l archive

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

David Given wrote:
Lua gets away with __gc because it has very restricted functionality; finalisers can only be written in C, the finalised objects can't be resurrected, the finalisers can't block, etc. IMO, this is a Very Good Thing.

I'm not sure the above is exactly true.  It's perfectly safe for
the C finaliser to call back into Lua, and I've got a feeling that
the finalised objects can indeed be resurrected - at least
there's no documented warning, IIRC, about making a new long-living
ref to the object in question, within the finaliser.

Adam D. Moss   -