DIP60: @nogc attribute

via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 18 07:00:21 PDT 2014


On Friday, 18 April 2014 at 12:55:59 UTC, Steven Schveighoffer 
wrote:
> The important thing to recognize is that it's the *caller* that 
> increments/decrements. This means you can elide calls to an 
> object where you already have a guarantee of its reference 
> count being high enough.

That won't help you if you iterate over an array, so you need a 
mutex on the array in order to prevent inc/dec for every single 
object you inspect.

inc/dec with a lock prefix could easily cost you 150-200 cycles.


Ola.


More information about the Digitalmars-d mailing list