Date: Fri, 4 May 2018 22:33:54 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333265 - head/sys/sys Message-ID: <201805042233.w44MXsC7089190@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Fri May 4 22:33:54 2018 New Revision: 333265 URL: https://svnweb.freebsd.org/changeset/base/333265 Log: 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 Modified: head/sys/sys/systm.h head/sys/sys/zutil.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri May 4 21:17:29 2018 (r333264) +++ head/sys/sys/systm.h Fri May 4 22:33:54 2018 (r333265) @@ -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, Modified: head/sys/sys/zutil.h ============================================================================== --- head/sys/sys/zutil.h Fri May 4 21:17:29 2018 (r333264) +++ head/sys/sys/zutil.h Fri May 4 22:33:54 2018 (r333265) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805042233.w44MXsC7089190>