lua-users home
lua-l archive

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


Lua5 manual states that user data objects are collected in the order reverse to that of their creation. It, however, doesn't say anything about the order of GC in general. Hence, given two arbitrary Lua objects O1 and O2, can assumption be made that O1 is destroyed after O2 if it was created before O2 and vice versa?

Another question I have is about GC in weak tables. Given a weak table with both keys and values being weak, is there any specific order in which a key is collected with respect to its value?

Also, assuming objects are collected in a specific order in Lua 5, is this likely to change in future versions of Lua? 

For the moment I make no assumptions on the order at which objects and key/values are destroyed, but, I wish I could make one:)

Thank you,
Alex