path: root/firmware/libc
diff options
authorMichael Sevakis <>2014-08-06 04:26:52 -0400
committerMichael Sevakis <>2014-08-29 22:06:57 -0400
commit77b3625763ae4d5aa6aaa9d44fbc1bfec6b29335 (patch)
tree74b12e2669da8653932f48f1ca3816eef4bf6324 /firmware/libc
parent7d1a47cf13726c95ac46027156cc12dd9da5b855 (diff)
Add mempcpy implementation
A GNU extension that returns dst + size instead of dst. It's a nice shortcut when copying strings with a known size or back-to-back blocks and you have to do it often. May of course be called directly or alternately through __builtin_mempcpy in some compiler versions. For ASM on native targets, it is implemented as an alternate entrypoint to memcpy which adds minimal code and overhead. Change-Id: I4cbb3483f6df3c1007247fe0a95fd7078737462b
Diffstat (limited to 'firmware/libc')
1 files changed, 1 insertions, 0 deletions
diff --git a/firmware/libc/include/string.h b/firmware/libc/include/string.h
index 9346611aee..9815c62805 100644
--- a/firmware/libc/include/string.h
+++ b/firmware/libc/include/string.h
@@ -20,6 +20,7 @@ extern "C" {
_PTR _EXFUN(memchr,(const _PTR, int, size_t));
int _EXFUN(memcmp,(const _PTR, const _PTR, size_t));
_PTR _EXFUN(memcpy,(_PTR, const _PTR, size_t));
+_PTR _EXFUN(mempcpy,(_PTR, const _PTR, size_t));
_PTR _EXFUN(memmove,(_PTR, const _PTR, size_t));
_PTR _EXFUN(memset,(_PTR, int, size_t));
char *_EXFUN(strcat,(char *, const char *));