Re: [dev] [st] [PATCH 4/3] tresize: remove unnecessary if

From: <noname_AT_inventati.org>
Date: Sun, 12 Apr 2015 09:48:32 +0000

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

This archive was generated by hypermail 2.3.0 : Sun Apr 12 2015 - 12:00:33 CEST