This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.18-572-g0dfa665
- From: neleai at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 10 Dec 2013 18:37:14 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.18-572-g0dfa665
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 0dfa665cc1fb3cf34ef4e173effe5651d4a8497d (commit)
from 5782a80f9f8ca86899b30161166f044b0b6b8590 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0dfa665cc1fb3cf34ef4e173effe5651d4a8497d
commit 0dfa665cc1fb3cf34ef4e173effe5651d4a8497d
Author: OndÅ?ej BÃlka <neleai@seznam.cz>
Date: Tue Dec 10 19:36:28 2013 +0100
Expand MALLOC_COPY and MALLOC_ZERO to memcpy and memset.
diff --git a/ChangeLog b/ChangeLog
index 12bbfbf..c7b18ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2013-12-10 OndÅ?ej BÃlka <neleai@seznam.cz>
+ * malloc/malloc.c (MALLOC_COPY, MALLOC_ZERO): Delete.
+ (__malloc_assert, __libc_realloc, __libc_calloc,
+ _int_realloc): Expand MALLOC_COPY and MALLOC_ZERO to
+ memcpy and memset.
+ * malloc/hooks.c (realloc_check): Likewise.
+
+2013-12-10 OndÅ?ej BÃlka <neleai@seznam.cz>
+
* malloc/Makefile (CPPFLAGS-malloc.c): Remove -DPER_THREAD flag.
* malloc/arena.c: Remove PER_THREAD conditional.
[!PER_THREAD]: Remove code.
diff --git a/malloc/hooks.c b/malloc/hooks.c
index 8784adb..7010fe6 100644
--- a/malloc/hooks.c
+++ b/malloc/hooks.c
@@ -330,7 +330,7 @@ realloc_check(void* oldmem, size_t bytes, const void *caller)
if (top_check() >= 0)
newmem = _int_malloc(&main_arena, bytes+1);
if (newmem) {
- MALLOC_COPY(newmem, oldmem, oldsize - 2*SIZE_SZ);
+ memcpy(newmem, oldmem, oldsize - 2*SIZE_SZ);
munmap_chunk(oldp);
}
}
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 4437ee2..b1668b5 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1072,19 +1072,6 @@ static void* malloc_atfork(size_t sz, const void *caller);
static void free_atfork(void* mem, const void *caller);
#endif
-
-/* ------------- Optional versions of memcopy ---------------- */
-
-
-/*
- Note: memcpy is ONLY invoked with non-overlapping regions,
- so the (usually slower) memmove is not needed.
-*/
-
-#define MALLOC_COPY(dest, src, nbytes) memcpy(dest, src, nbytes)
-#define MALLOC_ZERO(dest, nbytes) memset(dest, 0, nbytes)
-
-
/* ------------------ MMAP support ------------------ */
@@ -2956,7 +2943,7 @@ __libc_realloc(void* oldmem, size_t bytes)
/* Must alloc, copy, free. */
newmem = __libc_malloc(bytes);
if (newmem == 0) return 0; /* propagate failure */
- MALLOC_COPY(newmem, oldmem, oldsize - 2*SIZE_SZ);
+ memcpy(newmem, oldmem, oldsize - 2*SIZE_SZ);
munmap_chunk(oldp);
return newmem;
}
@@ -2987,7 +2974,7 @@ __libc_realloc(void* oldmem, size_t bytes)
newp = __libc_malloc(bytes);
if (newp != NULL)
{
- MALLOC_COPY (newp, oldmem, oldsize - SIZE_SZ);
+ memcpy (newp, oldmem, oldsize - SIZE_SZ);
_int_free(ar_ptr, oldp, 0);
}
}
@@ -3175,7 +3162,7 @@ __libc_calloc(size_t n, size_t elem_size)
if (chunk_is_mmapped (p))
{
if (__builtin_expect (perturb_byte, 0))
- return MALLOC_ZERO (mem, sz);
+ return memset (mem, 0, sz);
return mem;
}
@@ -3197,7 +3184,7 @@ __libc_calloc(size_t n, size_t elem_size)
assert(nclears >= 3);
if (nclears > 9)
- return MALLOC_ZERO(d, clearsize);
+ return memset(d, 0, clearsize);
else {
*(d+0) = 0;
@@ -4201,7 +4188,7 @@ _int_realloc(mstate av, mchunkptr oldp, INTERNAL_SIZE_T oldsize,
assert(ncopies >= 3);
if (ncopies > 9)
- MALLOC_COPY(d, s, copysize);
+ memcpy(d, s, copysize);
else {
*(d+0) = *(s+0);
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 ++++++++
malloc/hooks.c | 2 +-
malloc/malloc.c | 23 +++++------------------
3 files changed, 14 insertions(+), 19 deletions(-)
hooks/post-receive
--
GNU C Library master sources