www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D Garbage Collector

reply Vincent Richomme <forumer smartmobili.com> writes:
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 ?
Oct 06 2008
parent reply Sean Kelly <sean invisibleduck.org> writes:
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
Oct 06 2008
parent Chad J <gamerchad __spam.is.bad__gmail.com> writes:
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.
Oct 06 2008