This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Improve bcopy performance
- From: "Wilco Dijkstra" <wdijkstr at arm dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Mon, 12 Jan 2015 15:14:10 -0000
- Subject: [PATCH] Improve bcopy performance
- Authentication-results: sourceware.org; auth=none
Rather than using a C implementation of memmove, directly call memmove, which typically has a much
faster optimized implementation.
ChangeLog:
2015-01-12 Wilco Dijkstra wdijkstr@arm.com
* string/bcopy.c (bcopy): Call memmove for performance.
---
string/bcopy.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/string/bcopy.c b/string/bcopy.c
index f497b5d..b26f347 100644
--- a/string/bcopy.c
+++ b/string/bcopy.c
@@ -15,14 +15,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <stdarg.h>
#include <string.h>
-#define memmove bcopy
-#define rettype void
-#define RETURN(s) return
-#define a1 src
-#define a1const const
-#define a2 dest
-#define a2const
-
-#include <string/memmove.c>
+void
+bcopy (const void *src, void *dest, size_t len)
+{
+ memmove (dest, src, len);
+}
--
1.9.1