Smart pointers instead of GC?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Feb 4 10:39:28 PST 2014


On 2/4/14, 6:26 AM, Frank Bauer wrote:
> On Tuesday, 4 February 2014 at 06:47:03 UTC, Walter Bright wrote:
>> On 2/3/2014 7:03 PM, Adam Wilson wrote:
>>> Note that ObjC has special syntax to handle weak pointers. It's not well
>>> understood by many.
>>
>> Sounds like explicitly managed memory is hardly worse.
>>
>> On 2/3/2014 3:13 PM, woh wrote:
>>>
>>>  Any system that forces a single way of handling memory as the only
>>> viable
>>> method, be it GC( as D currently does)
>>
>> This is incorrect. You can use malloc/free in D, as well as write &
>> use your own allocators, and even write your own ref counted types.
>>
>> On 2/3/2014 1:42 PM, Shammah Chancellor wrote:
>>> It's also probably
>>> possible to create a drop-in replacement for the GC to do something
>>> else.
>>
>> It certainly is possible. There's nothing magic about the current GC,
>> it's just library code.
>
>
> Andrei Alexandrescu wrote:
>> 2. Work on Phobos to see what can be done about avoiding unnecessary
>> allocation. Most likely we'll need to also add a @nogc flag.
>> ...
>> 4. Work on the core language and druntime to see how to seamlessly
>> accommodate alternate GC mechanisms such as reference counting.
>> ...
>> I thought I made it clear that GC avoidance (which includes
>> considering built-in reference counting) is a major focus of 2014.
>>
>> Andrei
>
> Im totally confused: Walter, do you back what Andrei says or do we have
> a good cop / bad cop situation here?

There's no contradiction. Walter and I are on the same page.

Andrei



More information about the Digitalmars-d mailing list