Logo
Explore Help
Sign In
fluencelabs/musl
1
0
Fork 0
You've already forked musl
mirror of https://github.com/fluencelabs/musl synced 2025-06-27 05:32:06 +00:00
Code Issues Projects Releases Wiki Activity
Files
594318fd3d13c7dda1ea87a76934e052ac74301f
musl/src/string/memmove.c

14 lines
236 B
C
Raw Normal View History

initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
#include <string.h>
void *memmove(void *dest, const void *src, size_t n)
{
char *d = dest;
const char *s = src;
if (d==s) return d;
remove dependency of memmove on memcpy direction this commit introduces a performance regression in many uses of memmove, which will need to be addressed before the next release. i'm making it as a temporary measure so that the restrict patch can be committed without invoking undefined behavior when memmove calls memcpy with overlapping regions.
2012-09-06 20:25:48 -04:00
if ((size_t)(d-s) < n)
initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
while (n--) d[n] = s[n];
remove dependency of memmove on memcpy direction this commit introduces a performance regression in many uses of memmove, which will need to be addressed before the next release. i'm making it as a temporary measure so that the restrict patch can be committed without invoking undefined behavior when memmove calls memcpy with overlapping regions.
2012-09-06 20:25:48 -04:00
else
while (n--) *d++ = *s++;
return dest;
initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.2 Page: 231ms Template: 5ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API