about summary refs log tree commit diff
path: root/malloc/malloc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-12-27 23:27:22 +0000
committerUlrich Drepper <drepper@redhat.com>2000-12-27 23:27:22 +0000
commit5fba3e5e3c6fd862a7159059898812ecfcf4249d (patch)
tree3cace916d4e6045fb28862dc05b0eba576b5bb16 /malloc/malloc.c
parentde149cdbaf9327b5dbb85b1a473fce5c6ec7951f (diff)
downloadglibc-5fba3e5e3c6fd862a7159059898812ecfcf4249d.tar.gz
glibc-5fba3e5e3c6fd862a7159059898812ecfcf4249d.tar.xz
glibc-5fba3e5e3c6fd862a7159059898812ecfcf4249d.zip
(memmove): Add prototypes. (MALLOC_MEMMOVE): Define. (chunk_realloc): Use it instead of MALLOC_COPY if source and destination might overlap.
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r--malloc/malloc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 2eb9c558b9..187c8147a0 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -415,9 +415,11 @@ extern "C" {
 #if __STD_C
 void* memset(void*, int, size_t);
 void* memcpy(void*, const void*, size_t);
+void* memmove(void*, const void*, size_t);
 #else
 Void_t* memset();
 Void_t* memcpy();
+Void_t* memmove();
 #endif
 #endif
 
@@ -462,6 +464,9 @@ do {                                                                          \
   } else memcpy(dest, src, mcsz);                                             \
 } while(0)
 
+#define MALLOC_MEMMOVE(dest,src,nbytes)                                       \
+  memmove(dest, src, mcsz)
+
 #else /* !USE_MEMCPY */
 
 /* Use Duff's device for good zeroing/copying performance. */