lua-users home
lua-l archive

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


[These are questions I think should be answered by the Manual. Not
questions that I have.]

o Can a "resurrected" object (finalizer saves a strong reference to
the object) be finalized more than once?

o In this paragraph:

"Objects marked for finalization have a special behavior in weak
tables. When a marked object is a value in a weak table, it is removed
from the table before running its finalizer. However, when it is a
key, it is removed from the table only after running its finalizer.
This behavior allows the finalizer to access properties associated
with the object through weak tables."

Is the object removed from the weak table even if the finalizer
"resurrects" the object? If not, it probably should be emphasized that
the userdata is always removed when it is a value in a weak table.

o How are the key/value pairs in a userdata's uservalue (table) marked
in the GC sweep before it is finalized (the GC sweep where the
userdata is determined to be unreachable). [This is not clear in the
Lua 5.1 Manual either.] This seems to be a steady source of confusion
as evidenced by the recent postings to lua-l.

-- 
- Patrick Donnelly