Boost logo

Boost :

Subject: Re: [boost] discussion of garbage collection in C++
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-04-25 15:27:18

On Sat, Apr 25, 2009 at 10:47 AM, Edward Diener <eldiener_at_[hidden]> wrote:
> Raindog wrote:
> That is why I think that a real solution to using RAII and GC in C++ must
> come from the ability to tag objects at the class level, and only
> occasionally at the object level

I agree with most of what you're saying, I myself am not a fan of GC
however I do appreciate its benefits in some cases, when all of the
resources being managed allow non-deterministic termination (memory
being the most important such resource.) Yet, occasionally even memory
needs to be managed deterministically. So I disagree with your
assertion that classes should be tagged for GC, and not individual
object instances.

One of the best features of shared_ptr is the fact that it abstracts
resource management at object instance level. I know this is wishful
thinking, but the ideal solution as far as I'm concerned would be to
implement GC as a custom (non-deterministic) allocation strategy,
per-instance, as a custom shared_ptr allocator.

Emil Dotchevski
Reverge Studios, Inc.

Boost list run by bdawes at, gregod at, cpdaniel at, john at