Smart pointers instead of GC?

Adam Wilson flyboynw at gmail.com
Mon Feb 3 12:52:53 PST 2014


On Mon, 03 Feb 2014 12:40:20 -0800, Dmitry Olshansky  
<dmitry.olsh at gmail.com> wrote:

> 04-Feb-2014 00:21, Adam Wilson пишет:
>> On Mon, 03 Feb 2014 12:02:29 -0800, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>
>>> On 2/3/14, 6:57 AM, Frank Bauer wrote:
>>>> Anyone asking for the addition of ARC or owning pointers to D, gets
>>>> pretty much ignored. The topic is "Smart pointers instead of GC?",
>>>> remember? People here seem to be more interested in diverting to
>>>> nullable, scope and GC optimization. Telling, indeed.
>>>
>>> I thought I made it clear that GC avoidance (which includes
>>> considering built-in reference counting) is a major focus of 2014.
>>>
>>> Andrei
>>>
>>
> ...
>> Sadly, although written as hyperbole, I feel that the above is fairly
>> close to the actual position of the ARC crowd.
>>
>
> I won't be surprised that half of current GC problems are because it's  
> simply too stupid as an allocator. I had some numbers that I'd need to  
> dig up were GC.malloc was ~2x slower then malloc even with garbage  
> collection disabled.
>
> With that said I'd focus on ref-counting somehow coexisting with tracing  
> GC. It doesn't go well at the moment - try creating dynamic arrays of  
> std.stdio.File (that is ref-counted).
>

I will not defend the current GC, it is about as stupid as you can make  
one and still have a functioning memory management system. It implements  
exactly none of the optimizations recommended for Mark-Sweep GC's in the  
GC Handbook.

That said, I firmly believe that wholesale replacement of the GC is  
throwing the baby out with the bathwater. Effectively, the poor D GC  
implementation has become an excuse to launch a crusade against all GC's  
everywhere, never mind that Java and the .NET GC's are consistent examples  
of just how good GC's can actually be.

-- 
Adam Wilson
GitHub/IRC: LightBender
Aurora Project Coordinator


More information about the Digitalmars-d mailing list