Is Phobos's Garbage Collector utterly broken? (Phobos vs Tango)
Deewiant
deewiant.doesnotlike.spam at gmail.com
Wed Aug 1 07:57:31 PDT 2007
Sean Kelly wrote:
> Vladimir Panteleev wrote:
>> 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.
>
Isn't this also a problem with all the IO stuff that use void[] for everything?
It starts right up there at IBuffer and IConduit.
The way I see it: void[] is for "pure memory" that you might want to access in
multiple different ways (akin to unions), ubyte[] is for the traditional model
of "arbitrary data", and byte[] is just weird, I've yet to figure out a use for it.
--
Remove ".doesnotlike.spam" from the mail address.
More information about the Digitalmars-d
mailing list