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: [RFC] Do not call memmove when memcpy suffices.


The sole purpose of the memmove function is to support the possibility of
overlap.  If the programmer knows there is no possibility of overlap, then
they should just use memcpy.  (Of course, _FORTIFY_SOURCE checks for
overlap in memcpy would be a very wise thing to have.)  If anything, the
only thing that should be done with a macro or inline for memmove is to
transmute it to memcpy when it is determinable at compile time that there
is no possibility of overlap.  Anything requiring run-time detection should
be done in the memmove implementation itself.


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