Messages in this thread | | | Date | Mon, 19 Jan 2004 16:49:54 -0800 | From | Richard Henderson <> | Subject | Re: [PATCH] Modernize i386 string.h |
| |
On Sun, Jan 18, 2004 at 09:09:19PM +0100, Andi Kleen wrote: > +#define __HAVE_ARCH_MEMCPY 1 > +extern void *__memcpy(void *to, const void *from, size_t len); > +#define memcpy(dst,src,len) \ > + ({ size_t __len = (len); \ > + void *__ret; \ > + if (__builtin_constant_p(len) && __len >= 128) \ > + __ret = __memcpy((dst),(src),__len); \ > + else \ > + __ret = __builtin_memcpy((dst),(src),__len); \ > + __ret; })
Why not just __builtin_memcpy? Or indeed, why bother defining anything at all, since the compiler will infer __builtin_memcpy from the external symbol memcpy.
r~ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |