[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: GC "survey"
- From: "Thatcher Ulrich" <tu@...>
- Date: Sat, 24 Aug 2002 00:40:57 -0400
On Aug 24, 2002 at 12:25 +0900, John Belmonte wrote:
> I have little interest in a generational collector. It's going to
> add complexity for uncertain return. It won't help graphical
> applications that have to meet a hard video frame deadline (such as
> when doing interlace video with only one output buffer) very much.
> (Or perhaps not at all, now that I see this talk of needing an
> "occasional" full gc even with a generational collector unless you
> do some programming acrobatics.)
Incremental *and* generational is the holy grail I think, if it's not
too bloated. Either one will be an improvement over vanilla
mark-and-sweep. I agree with you that incremental is more desirable
I'm not totally against reference-counting as a solution either -- we
use it at work in our C++ code and it performs decently. We use weak
pointers to get around the problem with cycles.
> What I'd like to see is for the authors to do the exercise of adding
> a real-time write-barrier type gc to Lua. Now, I'm not suggesting
> that this become the default, because such a gc, although it will
> reduce worst case gc times, will increase program execution time.
> Rather, from the exercise, we can gather how to make the gc
> framework general enough to support both mark-and-sweep and
> real-time collectors, and discover if this generality can be done
> without hurting Lua's current performance. Of course, the game
> people will also gain a useful gc in the process :-).
Any incremental GC will need a write barrier, which is IMO the most
difficult part to get right; I'd be pretty happy with a macro in the
Lua core that encapsulated all pointer writes into the heap or stack.
Such a macro could just do the normal write by default, or be
optionally redefined by an incremental GC patch. When I was last
looking into this, it almost seemed like the Lua core already had this
macro, but I wasn't totally certain of what I was seeing.
paul@theV.net posted a while back about an experimental incremental GC
patch he made, but the link seems to be dead. Paul, what's the status