lua-users home
lua-l archive

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


> I think I misunderstand "in the reverse order that they were marked
> for finalization".

"Marked for finalization" has a special and well-defined meaning
there. It is explained two paragraphs before the one you misunderstood:

  For an object (table or userdata) to be finalized when collected, you
  must mark it for finalization.  You mark an object for finalization
  when you set its metatable and the metatable has a field indexed by
  the string __gc.

So, "in the reverse order that they were marked for finalization" means
in the reverse order that they got a metatable with a __gc field (which,
more often than not, is just after they were created).

-- Roberto