DIP77 - Fix unsafe RC pass by 'ref'

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Fri May 1 15:08:11 PDT 2015


Am Sat, 11 Apr 2015 20:42:52 +0000
schrieb "deadalnix" <deadalnix at gmail.com>:

> On Saturday, 11 April 2015 at 18:20:51 UTC, Marco Leise wrote:
> > Am Fri, 10 Apr 2015 14:04:39 +0000
> > schrieb "Ola Fosheim Grøstad"
> > <ola.fosheim.grostad+dlang at gmail.com>:
> >
> >> On Friday, 10 April 2015 at 10:28:03 UTC, Walter Bright wrote:
> >> > That's what ref counting is about.
> >> 
> >> That would require pervasive ref-counting.
> >
> > You make is sound like there was an alternative to ref
> > counting for resources. Is there?
> 
> Ownership, GC.

That doesn't convince me yet. GC is just incorrect to use here.
D's GC like any other that is non-deterministic will hold on
to many external resources for longer than is feasible.

(Unique) ownership on the other hand isn't really what we are
looking at here, right? I mean, the DIP talks about what
happens when you are dealing with multiple references to
the same item.

That leaves us with RC, which I think is a good choice.

-- 
Marco



More information about the Digitalmars-d mailing list