Is Phobos's Garbage Collector utterly broken? (Phobos vs Tango)
Sean Kelly
sean at f4.ca
Wed Aug 1 12:33:01 PDT 2007
Vladimir Panteleev wrote:
> On Wed, 01 Aug 2007 17:48:26 +0300, Sean Kelly <sean at f4.ca> wrote:
>
>> 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.
>
> Cheers, that indeed fixed it. And now it runs much faster than the Phobos version, too!
>
> What's the reasoning of scanning void[] - why would anyone keep pointers in a void[] since it's supposed to mean "binary non-descript data"?
I think the idea was that a void array may contain /anything/ including
structs, in-place constructed classes, array references, etc, and it was
easier specifying that void arrays be scanned than expecting the user to
call gc.hasPointers() or whatever on the memory block every time a
reallocation occurs.
Sean
More information about the Digitalmars-d
mailing list