lkml.org 
[lkml]   [2004]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.057 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site