On Sun, Apr 12, 2015 at 11:35:42AM +0200, Silvan Jegen wrote:
> I just wonder if it really will be copying the data around into a
> temporary array for no reason when i == 0 (either in glibc or in another
> libc).
Well, it does not really move data to temporary array, memmove just
chooses the right direction so it does not destroy data.
glibc indeed wastes CPU cycles if dst == src, However, musl does not:
http://git.musl-libc.org/cgit/musl/tree/src/string/memmove.c
Received on Sun Apr 12 2015 - 11:48:32 CEST