RFC: moving forward with @nogc Phobos

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 30 05:51:23 PDT 2014


On Tuesday, 30 September 2014 at 12:32:08 UTC, Ola Fosheim 
Grøstad wrote:
> On Tuesday, 30 September 2014 at 12:02:10 UTC, Johannes Pfau 
> wrote:
>> ...
>
> > Also the idea exposed in this thread that release()/retain() 
> > is
> purely arithmetic and can be optimized as such is quite wrong. 
> retain() is conceptually a locking construct on a memory region 
> that prevents reuse. I've made a case for TSX, but one can 
> probably come up with other multi-threaded examples.
>

It works when two big ifs come together.

- inside the same scope (e.g. function level)

- when the referece is not shared between threads.

While it is of limited applicability, Objective-C (and eventually 
Swift) codebases prove it helps in most real life use cases.

--
Paulo


More information about the Digitalmars-d mailing list