D Garbage Collector

Chad J gamerchad at __spam.is.bad__gmail.com
Mon Oct 6 20:16:33 PDT 2008


Sean Kelly wrote:
> Vincent Richomme wrote:
>> Hi,
>>
>> Sorry for this stupid question but what is the difference between the 
>> boehm gc found in GCC sources and the garbage stategy used in D ?
> 
> There's functionally little difference between the two.  Both are 
> conservative mark-sweep GCs.
> 
> 
> Sean

I believe D's GC is (automatically) type aware while Boehm GC isn't. 
This means D's GC does not spend time scanning atomic data (data with no 
pointers) such as strings, audio samples, pixmaps, etc, while Boehm GC 
would.  In theory this optimization allows it to run faster and prevent 
some memory leaks.  I think that Boehm GC allows you to manually tell it 
when things are atomic though, so if you are meticulous about it you 
could have the same optimization with Boehm GC.



More information about the Digitalmars-d mailing list