]> git.baikalelectronics.ru Git - uboot.git/commit
string: Use memcpy() within memmove() when we can
authorSimon Glass <sjg@chromium.org>
Wed, 5 Apr 2017 22:23:31 +0000 (16:23 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 10 May 2017 00:19:04 +0000 (20:19 -0400)
commit3f86cc4b37d6c7aff5188bf8f4f767482bf18e08
tree8e4bb6377bcafcd626ed0bcbcdf960fad5cd1ceb
parentdfc16cdddcdca848c8f49ebbe4c400b717d4f7e1
string: Use memcpy() within memmove() when we can

A common use of memmove() can be handled by memcpy(). Also memcpy()
includes an optimisation 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 memcpy() if the destination is before the source.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
lib/string.c