Is Phobos's Garbage Collector utterly broken? (Phobos vs Tango)

Sean Kelly sean at f4.ca
Wed Aug 1 07:48:26 PDT 2007


Vladimir Panteleev wrote:
> On Wed, 01 Aug 2007 09:08:16 +0300, Vladimir Panteleev <thecybershadow at gmail.com> wrote:
> 
>> I initially wrote it to try to find a memory leak in Tango's GC (which was actually fixed at some point).
> 
> Turns out it's still there, and it's the old "binary data" issue with pointer-searching GCs, which was fixed in D/Phobos 1.001 by making the GC type-aware. Check out the attached sample programs for a simple example - the Tango version can't know there are no pointers in its GrowBuffer's data, and thus leaks like crazy, while the Phobos version stays at 13MB.

It turns out this is because GrowBuffer uses a void[] internally to 
store data.  The type should probably be changed to byte[].  I'll file a 
ticket for it.

Sean



More information about the Digitalmars-d mailing list