lua-users home
lua-l archive

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


Maybe, but then you potentially want to keep other things alive as well, so
it seems generally better to have a live objects table for userdata that is
externally reachable. The external references issue may have been one of the
reasons I found myself thinking about wanting a way to resurrect userdata in
the __gc metamethod (or to provide resurrection notification), but the
object graph issues lead me to realize that this wouldn't necessarily solve
the problem.

Mark

on 7/26/04 7:43 PM, Edgar Toernig at froese@gmx.de wrote:

> Mark Hamburg wrote:
>> 
>> Finally, one thing I have found myself wanting on occasion is a way to
>> report resurrection in a __gc metamethod so that I would get another call if
>> the object became unreachable again. This should just be the matter of
>> setting a flag back. Unfortunately, I can't think right now of why I thought
>> this might be useful.
> 
> Maybe the gc-method noticed that the userdata is still referenced by
> other C structures (i.e. ref-count not zero) and has to be kept for
> a while...
> 
> Ciao, ET.