mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2025-02-20 11:38:25 -06:00
Get rid of memcpy(), as __builtin_memcpy() is globally smaller - and faster anyway - in all current and foreseeable occurrences.
This commit is contained in:
parent
438201195d
commit
cd68333f86
10
lib/string.c
10
lib/string.c
@ -43,16 +43,6 @@ int memcmp(const void *s1, const void *s2, size_t n)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *memcpy(void *dest, const void *src, size_t n)
|
||||
{
|
||||
char *d = (char *)dest, *s = (char *)src;
|
||||
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
d[i] = s[i];
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
void *memmove(void *dest, const void *src, size_t n)
|
||||
{
|
||||
char *d = (char *)dest, *s = (char *)src;
|
||||
|
@ -24,8 +24,9 @@ int memcmp(const void *s1, const void *s2, size_t n);
|
||||
* Copies n bytes from the memory area pointed to by src to the memory area
|
||||
* pointed to by dest and returns a pointer to dest. The memory areas must
|
||||
* not overlap.
|
||||
* void *memcpy(void *dst, const void *src, size_t n);
|
||||
*/
|
||||
void *memcpy(void *dst, const void *src, size_t n);
|
||||
#define memcpy(d, s, n) __builtin_memcpy((d), (s), (n))
|
||||
|
||||
/**
|
||||
* Copies n bytes from the memory area pointed to by src to the memory area
|
||||
|
Loading…
Reference in New Issue
Block a user