Garbage Collection in Circle

From: James Turner (turnerjh@XTN.NET)
Date: 04/20/98

I've recently been doing some reading on garbage collection in C
programs and have been pointed to a very interesting package.  I've
not downloaded or installed it yet, but it looks _very_ promising (and
has quite a few testimonials to its qualities).  The package is
written by Hans Boehm, and some information is available at (the info is somewhat old, and there
is a link to newer information... which doesn't work).

For those unfamiliar with garbage collecting, basically it keeps track
of memory allocation, removing the need to worry about free()ing
blocks of memory when they are unused.  Some (including Boehm's) work
my using mark and sweep.  They trace through the stack, and all memory
allocations, and find all possible memory references.  They then
release any memory not pointed to.  This works very well because
memory is unneeded if there is no way to make references to it.

There is quite a bit of research, both theoretical and practical,
concerning the time/space tradeoffs of garbage collection (GC) versus
explicit memory management.  Effectively, GCing can compete in both
respects.  In particular, it can reduce code size and complexity by
eliminating the need to worry about memory management.

Boehm's package is, for all intents and purposes, a drop-in
replacement for malloc.  Basically you change calls to malloc to
GC_malloc, and remove calls to free.  I'm going to experiment over the
next few days on this and if anyone is interested, I'll report back.
Boehm's package supports a large number of environments -- at least as
many as Circle.  What are the chances of getting it incorporated into
Circle, should the powers that be deem it useful?


James Turner     

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST