lua-users home
lua-l archive

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


The 5.1 refrence manual says about garbage collecting userdata:

"At the end of each garbage-collection cycle, the finalizers for
userdata are called in reverse order of their creation, among those
collected in that cycle. That is, the first finalizer to be called is
the one associated with the userdata created last in the program. The
userdata itself is freed only in the next garbage-collection cycle. "

But this does not imply that the __gc field is called twice, right?
I.e. the __gc field of any userdata value is called exactly only once,
is that correct?

Thanks,
Marc