lua-users home
lua-l archive

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


> That said, doing so would mean that userdata that needed to access
> other data would have to use the userdata environment rather than
> weak tables, so it's going to break some code out there that failed
> to adopt environments as the mechanism of choice.

My suggestion was to move the clearing only of weak values. Weak keys
would continue to be cleared after the separation of userdata. (Lua 5.2
has different 'cleartable' calls for different degrees of weaknesses.)
So, this technique (weak userdata -> strong value used in finalization)
would continue to work as before.


> If I don't care about that change in semantics, is the minimal change
> to Lua 5.1 to move the cleartable call above the marktmu call?

I think so, but I would have to test.

-- Roberto