Improve bcopy performance
Commit Message
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(-)
Comments
> +#include <stdarg.h>
> #include <string.h>
There is no reason for this new #include. Drop it.
Otherwise this is fine and I think it's safe enough during the freeze, but
there is no burning (melting?) reason to rush it if folks are feeling
conservative.
This is fine. I think it's safe enough during the freeze, but there is no
burning (melting?) reason to rush it if folks are feeling conservative.
> Roland McGrath wrote:
> > +#include <stdarg.h>
> > #include <string.h>
>
> There is no reason for this new #include. Drop it.
>
> Otherwise this is fine and I think it's safe enough during the freeze, but
> there is no burning (melting?) reason to rush it if folks are feeling
> conservative.
Commited without the include.
Wilco
@@ -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);
+}