Make memset in calloc a tail call.
authorOndřej Bílka <neleai@seznam.cz>
Thu, 28 Nov 2013 11:03:28 +0000 (12:03 +0100)
committerOndřej Bílka <neleai@seznam.cz>
Thu, 28 Nov 2013 11:05:50 +0000 (12:05 +0100)
ChangeLog
malloc/malloc.c

index 49df74a9f468f9c2c456cb4157492fa1182fce78..4c4e8e8a2c0a6cbf9b643b6f7186880831533f1f 100644 (file)
--- 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
index c8a5374e65798c4345fb52297418b83d9827d673..8977687f8c37d4d9805be78a020e1ec295674f85 100644 (file)
@@ -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;