lua-users home
lua-l archive

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

On Fri, Feb 13, 2009 at 8:22 AM, Miles Bader <> wrote:
> Ariel Manzur <> writes:
>> it would be nice if the __gc entry was on the userdata itself instead
>> of the metatable..
> Why?  99% of the time, many objects share the same __gc, so there's
> little point in bloating userdata to make it per-object.

we've had problems with the amount of userdata waiting to be
collected, so it'd be nice to know which ones actually have a __gc..
in the case where userdata is used to represent C objects, not all the
instances need the finalizer, so usually the __gc just acts as a
proxy. In that case, just looking into the metatable is not enough.