am 79260746: Merge "libc: memmove(): non-overlapping block optim." into gingerbread

Merge commit '79260746dbed91babab415ea86fba0e3eb086429' into gingerbread-plus-aosp

* commit '79260746dbed91babab415ea86fba0e3eb086429':
  libc: memmove(): non-overlapping block optim.
This commit is contained in:
David 'Digit' Turner 2010-09-28 00:16:38 -07:00 committed by Android Git Automerger
commit 16922b7ebc

View File

@ -31,7 +31,11 @@ void *memmove(void *dst, const void *src, size_t n)
{
const char *p = src;
char *q = dst;
if (__builtin_expect(q < p, 1)) {
/* we can use highgly-optimized memcpy() if the destination
* is before the source, or if the two blocks are non-overlapping
*/
if (__builtin_expect((q < p || (q-p) <= (ptrdiff_t)n), 1)) {
return memcpy(dst, src, n);
} else {
#define PRELOAD_DISTANCE 64