]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - benchtests/bench-mempcpy.c
time/tst-strftime2.c: Make the file easier to maintain
[thirdparty/glibc.git] / benchtests / bench-mempcpy.c
index 94b84da3b2b6d0efea25f16901ab617ab1ac97e2..09f8557413f92d95d25c6396e74e9a3bc14d73ff 100644 (file)
@@ -1,5 +1,5 @@
 /* Measure mempcpy functions.
-   Copyright (C) 2013-2014 Free Software Foundation, Inc.
+   Copyright (C) 2013-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 #define TEST_NAME "mempcpy"
 #include "bench-string.h"
 
-char *simple_mempcpy (char *, const char *, size_t);
-
-IMPL (simple_mempcpy, 0)
-IMPL (mempcpy, 1)
-
 char *
-simple_mempcpy (char *dst, const char *src, size_t n)
+generic_mempcpy (char *dst, const char *src, size_t n)
 {
-  while (n--)
-    *dst++ = *src++;
-  return dst;
+  return memcpy (dst, src, n) + n;
 }
 
+IMPL (mempcpy, 1)
+IMPL (generic_mempcpy, 0)
+
 #include "bench-memcpy.c"