DIP60: @nogc attribute

Kapps via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 22 09:58:23 PDT 2014


On Tuesday, 22 April 2014 at 06:51:40 UTC, Ola Fosheim Grøstad
wrote:
> On Monday, 21 April 2014 at 23:02:54 UTC, Walter Bright wrote:
>> There is JUST NO WAY that:
>>
>>    struct RefCount {
>>        T* data;
>>        int* count;
>>    }
>>
>
> This is actually quite efficient compared to the standard 
> NSObject which uses a hashtable for refcounting:

iOS now on 64-bit processors doesn't necessarily use a hashtable
for refcounting. Basically, only 33 bits of the 64-bit pointer
are used to actually refer to an address, then 19 of the
remaining bits are used to store an inline reference count. Only
if the inline reference count exceeds these 19 bits (very rare)
do they switch to using a hashtable. It was one of the large
benefits of switching to ARM64 for the iPhone 5.


More information about the Digitalmars-d mailing list