Allow the compiler to use __builtin_memcpy

In particular this allows the compiler to avoid heavy-handed machinery
if the to be copied buffer is small.

Reviewed by:	jhb
This commit is contained in:
Mateusz Guzik 2018-05-04 22:33:54 +00:00
parent ef470d031a
commit 0bb311526d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333265
2 changed files with 1 additions and 1 deletions

View File

@ -275,6 +275,7 @@ void bzero(void * _Nonnull buf, size_t len);
void explicit_bzero(void * _Nonnull, size_t);
void *memcpy(void * _Nonnull to, const void * _Nonnull from, size_t len);
#define memcpy(to, from, len) __builtin_memcpy(to, from, len)
void *memmove(void * _Nonnull dest, const void * _Nonnull src, size_t n);
int copystr(const void * _Nonnull __restrict kfaddr,

View File

@ -32,7 +32,6 @@
#include <sys/param.h>
#include <sys/kernel.h>
# define HAVE_MEMCPY
# define memcpy(d, s, n) bcopy((s), (d), (n))
# define memset(d, v, n) bzero((d), (n))
# define memcmp bcmp