memory/array question

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 31 13:43:10 PDT 2014


Eric:

> Thanks. That really works.  I timed doing
>
> auto mySlice = ptr1[0 .. ptr2 - ptr1]; 1,000,000 times
>
> versus
>
> auto mySlice = ptr1[0 .. ptr2 - ptr1].dup; 1,000,000 times
>
> and I am quite convinced the data is not being copied.

Take a look at the asm!

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list