]> git.baikalelectronics.ru Git - uboot.git/commit
string: Use memcpy() within memmove() when we can
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Fri, 11 Dec 2020 13:59:23 +0000 (14:59 +0100)
committerTom Rini <trini@konsulko.com>
Sat, 16 Jan 2021 19:49:09 +0000 (14:49 -0500)
commitbe6f60d57d23c8bef3c8ffdf5d27cc57a8588863
treef4b242d831693ea73264ed44cb06d6f0912e83d4
parentcdce96d21ac5743d775eed00a519aa4804bc7898
string: Use memcpy() within memmove() when we can

A common use of memmove() can be handled by memcpy(). Also memcpy()
includes an optimization for large sizes: it copies a word at a time. So
we can get a speed-up by calling memcpy() to handle our move in this case.

Update memmove() to call also memcpy() if the source don't overlap
the destination (src + count <= dest).

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
lib/string.c