lua-users home
lua-l archive

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

Jim Pryor wrote:
> Namely, in standard Lua, U wouldn't be collectable inside bar because it
> would still be alive on bar's call stack, even if it's never used inside
> bar. But in LuaJIT the reference to U might be optimized away, and so
> a different technique for keeping it alive would be required.

LJ2 doesn't do this right now, but it might do this in the future.
Collection can happen at the earliest or the latest point. Or
anywhere inbetween. Or never. It's an implementation detail.

This issue is not specific to Lua. Here's an account of it in C#: