[gclist] Finalizers & Reference counting.

Boehm, Hans hans_boehm@hp.com
Thu, 29 Aug 2002 21:15:35 -0700

My understanding is that the garbage collector in gcc replaces the prior use of obstacks, which are basically manually managed regions.  I wasn't involved in the discussion, but the standard problems with this sort of approach are:

1) It's easy to introduce dangling pointers.  ANd the result is hard to debug.
2) It's hard to bound the amount of garbage you retain in live regions.

With automatic region inference (among other techniques), you can avoid (1), but I doubt that's practical here.  I suspect you need GC within regions to really deal with (2).


-----Original Message-----
From: Stefan Monnier
To: gclist@iecc.com
Sent: 8/29/02 1:38 PM
Subject: Re: [gclist] Finalizers & Reference counting.

>> I'm sure you've seen the e-mail from Linus Torvalds on the GCC
>> list about reference counting versus garbage collection. For those
>> may not have seen it, here is a quote from the e-mail:

What's wrong with regions ?
It can be an interesting middle point with fairly low programmer-cost
(it's not too hard to know when to free) and pretty low allocation and
deallocation cost as well.