[gclist] ref-counting performance cost

Bob Kerns Bob.Kerns@brightware.com
Tue, 10 Oct 2000 20:51:29 -0700


Perhaps your technique has relevance to non-traditional GC environments,
such as distributed GC, or other non-flat memory models, where the cost
tradeoffs are distinctly different?

Anyway, as to your last point: this technique is not exactly rare. It's
often later optimized with a reference count (to avoid the copy) and
copy-on-write (to preserve the un-shared semantics).

-----Original Message-----
From: Andrew Shi-hwa Chen [mailto:chenandr@cse.msu.edu]
Sent: Tuesday, October 10, 2000 5:29 PM
To: Bill Birch
Cc: gclist@iecc.com; chenandr@cse.msu.edu
Subject: %%: Re: [gclist] ref-counting performance cost 
...
> The bottom line is
> that whilst GC is technically superior, an effective implementation is
> complex. The average Joe Programmer does it with RC and probably finds it
> tough to debug but meets his/her ship dates.

I'd like to add one more technique that some programmer (mainly
myself) once tried to get a very easy to implement form of automatic
memory management - always use deep-copy semantics when assigning a
pointer, and always do a recursive free when releasing a pointer.
Highly inefficient, but it works. Slightly different semantics for
mutable objects though.

Thanks for your feedback,
Andrew Chen