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

Reply via email to