[svlug] Garbage Collection in C

J C Lawrence claw at kanga.nu
Tue Nov 25 19:01:59 PST 2003


On Wed, 26 Nov 2003 02:43:25 +0000 (GMT) 
iso  <iso-8859-1> wrote:

> Do we have any better technical approach to implement garbage
> collection in C, other than establishing a counter and freeing () the
> dynamic chunk when the count becomes zero.

Yes, a great many of them.  Spend some time mining citeseer.
Mark/sweep, red/black trees, incremental, there are many.
 
> I believe to make use of the storage classes ...

C or C++?

> ... of the pointers pointing to the chunk, the information embedded in
> the object file, by the compiler.
 
C doesn't have storage classes natively.  You can add them by
implementing your own wrapper on top of malloc() or sbrk().

> Thus, we go beyond the compilation phase, which I am not interested
> in.

I'm not sure what you mean here. 

-- 
J C Lawrence
---------(*)                Satan, oscillate my metallic sonatas.
claw at kanga.nu               He lived as a devil, eh?
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.




More information about the svlug mailing list