Smart pointers instead of GC?
Adam Wilson
flyboynw at gmail.com
Mon Feb 3 22:51:39 PST 2014
On Mon, 03 Feb 2014 22:39:02 -0800, Walter Bright
<newshound2 at digitalmars.com> 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.
>
Well special syntax is needed to make ARC work because of the requirement
to explicitly mark a pointer as a weak-reference. It would also mean that
all existing D code would subtly break (leak memory) in any case where a
weak-reference is required and was previously handled transparently by the
GC. I won't say that manually managed memory is worse, because it does
automatically clean up most of the trash, but ARC still allows to shot
yourself in the foot easily enough.
--
Adam Wilson
GitHub/IRC: LightBender
Aurora Project Coordinator
More information about the Digitalmars-d
mailing list