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:
parent
ef470d031a
commit
0bb311526d
@ -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,
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user