Skip to content

Commit

Permalink
(memmove): Add prototypes. (MALLOC_MEMMOVE): Define. (chunk_realloc):…
Browse files Browse the repository at this point in the history
… Use it instead of MALLOC_COPY if source and destination might overlap.
  • Loading branch information
Ulrich Drepper committed Dec 27, 2000
1 parent de149cd commit 5fba3e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions malloc/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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. */
Expand Down

0 comments on commit 5fba3e5

Please sign in to comment.