John Carmack applauds D's pure attribute
    Timon Gehr 
    timon.gehr at gmx.ch
       
    Tue Feb 28 00:30:12 PST 2012
    
    
  
On 02/27/2012 03:42 PM, Martin Nowak wrote:
...
>>> https://gist.github.com/1920202
>>
>> Neat. Possible improvement (if I understand your code correctly):
>> Don't add the GC range if all possible aliasing is through Ptr.
>
> I hope I did that.
import smart_ptr;
struct S{
     Ptr!int a;
     Ptr!double b;
}
static assert(hasAliasing!S);
Therefore, I think your code will add the storage of Ptr!S to the GC, 
even though it manages all its pointers manually.
> Or do you mean when holding a class. I think it's needed
> for classes because of the monitor, not sure though.
Is it needed for unshared class instances?
    
    
More information about the Digitalmars-d
mailing list