aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2013-11-28 12:03:28 +0100
committerOndřej Bílka <neleai@seznam.cz>2013-11-28 12:05:50 +0100
commit897b98ba4dacb02edc3c8775f207a9c9a25fc1e4 (patch)
tree7b166ac109b1c40515a34366e046f897143724cb
parent2ddb48d376f9c869ed964cc88bcf38613b0678b1 (diff)
downloadglibc-897b98ba4dacb02edc3c8775f207a9c9a25fc1e4.tar
glibc-897b98ba4dacb02edc3c8775f207a9c9a25fc1e4.tar.gz
glibc-897b98ba4dacb02edc3c8775f207a9c9a25fc1e4.tar.bz2
glibc-897b98ba4dacb02edc3c8775f207a9c9a25fc1e4.zip
Make memset in calloc a tail call.
-rw-r--r--ChangeLog4
-rw-r--r--malloc/malloc.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 49df74a9f4..4c4e8e8a2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-28 Ondřej Bílka <neleai@seznam.cz>
+
+ * malloc/malloc.c (__libc_calloc): Make memset a tail call.
+
2013-11-26 Uros Bizjak <ubizjak@gmail.com>
* soft-fp/op-4.h (_FP_FRAC_ASSEMBLE_4): Check rsize against
diff --git a/malloc/malloc.c b/malloc/malloc.c
index c8a5374e65..8977687f8c 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3181,7 +3181,7 @@ __libc_calloc(size_t n, size_t elem_size)
if (chunk_is_mmapped (p))
{
if (__builtin_expect (perturb_byte, 0))
- MALLOC_ZERO (mem, sz);
+ return MALLOC_ZERO (mem, sz);
return mem;
}
@@ -3203,7 +3203,7 @@ __libc_calloc(size_t n, size_t elem_size)
assert(nclears >= 3);
if (nclears > 9)
- MALLOC_ZERO(d, clearsize);
+ return MALLOC_ZERO(d, clearsize);
else {
*(d+0) = 0;