[PATCH][AArch64] Optimized memcpy/memmove
Wilco Dijkstra
wdijkstr@arm.com
Mon Oct 5 10:30:00 GMT 2015
> Zack Weinberg wrote:
> Making memcpy the same as memmove is dangerous because then people
> will fail to notice when they *should* have used memmove. If you do
> anything at all, detect an overlap and call abort().
Many memcpy implementations already behave like memmove for sizes smaller
than ~256 bytes, so combining them would not significantly increase the
danger. The behaviour of memcpy on overlaps is undefined, so it's reasonable
to do whatever happens to be fastest and do the additional checks in debug
libraries/sanitizers (oddly enough memcpy_chk does not check for overlaps).
Wilco
More information about the Libc-alpha
mailing list