Pointer aliasing in D (Was: Programming language benchmarks)

Timon Gehr timon.gehr at gmx.ch
Thu Apr 28 14:29:43 PDT 2011


> That allows specifying that the memory pointed to is only readable which
> enables doing the optimizations. But what if the memory is writable but
> I can my sure that the pointers pointing to it will never alias? How do
> I pass that information to the compiler?
>
> Jens

assert(p1 != p2); (or assert(c1 !is c2) for references).

I do not think DMD takes advantage of such constructs yet though.


More information about the Digitalmars-d mailing list