2005-06-03 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdlib/mallocr.c (MALLOC_COPY): Switch to use memmove instead of memcpy.
This commit is contained in:
parent
d9f491a77d
commit
15c04fd16e
2 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-06-03 Jeff Johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
|
* libc/stdlib/mallocr.c (MALLOC_COPY): Switch to use memmove
|
||||||
|
instead of memcpy.
|
||||||
|
|
||||||
2005-05-12 Jeff Johnston <jjohnstn@redhat.com>
|
2005-05-12 Jeff Johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
* configure.host (mn10300-*): Add long long I/O support by default.
|
* configure.host (mn10300-*): Add long long I/O support by default.
|
||||||
|
|
|
@ -487,6 +487,10 @@ extern void __malloc_unlock();
|
||||||
|
|
||||||
#define HAVE_MEMCPY
|
#define HAVE_MEMCPY
|
||||||
|
|
||||||
|
/* Although the original macro is called USE_MEMCPY, newlib actually
|
||||||
|
uses memmove to handle cases whereby a platform's memcpy implementation
|
||||||
|
copies backwards and thus destructive overlap may occur in realloc
|
||||||
|
whereby we are reclaiming free memory prior to the old allocation. */
|
||||||
#ifndef USE_MEMCPY
|
#ifndef USE_MEMCPY
|
||||||
#ifdef HAVE_MEMCPY
|
#ifdef HAVE_MEMCPY
|
||||||
#define USE_MEMCPY 1
|
#define USE_MEMCPY 1
|
||||||
|
@ -500,9 +504,11 @@ extern void __malloc_unlock();
|
||||||
#if __STD_C
|
#if __STD_C
|
||||||
void* memset(void*, int, size_t);
|
void* memset(void*, int, size_t);
|
||||||
void* memcpy(void*, const void*, size_t);
|
void* memcpy(void*, const void*, size_t);
|
||||||
|
void* memmove(void*, const void*, size_t);
|
||||||
#else
|
#else
|
||||||
Void_t* memset();
|
Void_t* memset();
|
||||||
Void_t* memcpy();
|
Void_t* memcpy();
|
||||||
|
Void_t* memmove();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -544,7 +550,7 @@ do { \
|
||||||
*mcdst++ = *mcsrc++; \
|
*mcdst++ = *mcsrc++; \
|
||||||
*mcdst++ = *mcsrc++; \
|
*mcdst++ = *mcsrc++; \
|
||||||
*mcdst = *mcsrc ; \
|
*mcdst = *mcsrc ; \
|
||||||
} else memcpy(dest, src, mcsz); \
|
} else memmove(dest, src, mcsz); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#else /* !USE_MEMCPY */
|
#else /* !USE_MEMCPY */
|
||||||
|
|
Loading…
Add table
Reference in a new issue