memcpy vs slice copy

Walter Bright newshound1 at digitalmars.com
Mon Mar 16 11:36:50 PDT 2009


Don wrote:
> Oh. I didn't see it was only 6 bytes. And the compiler even KNOWS it's 
> six bytes -- it's in the asm. Blimey. It should just be doing that as a 
> direct sequence of loads and stores, for anything up to at least 8 bytes.

The compiler will replace it with a simple mov if it is 1, 2, 4 or 8 bytes.



More information about the Digitalmars-d mailing list