This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] Inline mempcpy


On Mon, 18 May 2015, Wilco Dijkstra wrote:

> #if defined __USE_GNU && defined __OPTIMIZE__ && defined __extern_always_inline
> # if !defined _FORCE_INLINES && !defined _HAVE_STRING_ARCH_mempcpy
> 
> #undef mempcpy
> #undef __mempcpy
> #define mempcpy(dest, src, n) __mempcpy_inline (dest, src, n)
> #define __mempcpy(dest, src, n) __mempcpy_inline (dest, src, n)
> 
> __extern_always_inline void *
> __mempcpy_inline (void *__restrict __dest,
>                   const void *__restrict __src, size_t __n)
> {
>   return (char *) memcpy (__dest, __src, __n) + __n;
> }
> 
> # endif
> #endif

This seems plausible, subject to getting per-architecture agreement (for 
each architecture with mempcpy.S) on whether to define 
_HAVE_STRING_ARCH_mempcpy.  Although there may be the question of whether 
__extern_always_inline should be defined at all for !__GNUC_PREREQ (3,2) 
(i.e. when the always_inline attribute isn't supported).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]