[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT and keeping objects alive
- From: Mike Pall <mikelu-0911@...>
- Date: Wed, 25 Nov 2009 21:29:52 +0100
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#: