lua-users home
lua-l archive

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


Hi,

Philip Yi wrote:
> By setting "gc" tag methods on the userdata, I get a chance to delete
> the C++ objects, but I'm not guaranteed that the tag methods are
> called in any particular sequence.

Lua 4.0 calls the gc tag methods in order of tag value, highest tags
first.

> sequence. Unfortunately, Lua 4.0b allows "gc" tag methods to be set
> only for the userdata.  What is the reason for this? and can this
> decision be changed before the release of 4.0?

Because it's too dangerous.  You pass garbage objects back to the
system and then freem them.

Ciao, ET.