Re: [PATCH] Modernize i386 string.h

From: Richard Henderson
Date: Mon Jan 19 2004 - 20:02:22 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/