]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
__libc_dynarray_emplace_enlarge: Add missing else
authorFlorian Weimer <fweimer@redhat.com>
Wed, 6 Sep 2017 09:25:14 +0000 (11:25 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 4 Jan 2018 11:58:45 +0000 (12:58 +0100)
Before, arrays of small elements received a starting allocation size of
8, not 16.

(cherry picked from commit ab5ac271e6210fa0af11cf3ca525ce573bc47c48)

ChangeLog
malloc/dynarray_emplace_enlarge.c

index 66b74d4728674ee40b72b13b620b8df3007c9b46..0cc6ac650838a049698a31aa7573269c6cf75557 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-06  Florian Weimer  <fweimer@redhat.com>
+
+       * malloc/dynarray_emplace_enlarge.c
+       (__libc_dynarray_emplace_enlarge): Add missing else.
+
 2017-08-30  Florian Weimer  <fweimer@redhat.com>
 
        * malloc/dynarray_emplace_enlarge.c
index 0fb032765cc999520aaf4a63a58633bc97b3bc3a..a15245f4cb3d428886b3343eb8f9e5c0e4846f9d 100644 (file)
@@ -33,7 +33,7 @@ __libc_dynarray_emplace_enlarge (struct dynarray_header *list,
          size.  */
       if (element_size < 4)
         new_allocated = 16;
-      if (element_size < 8)
+      else if (element_size < 8)
         new_allocated = 8;
       else
         new_allocated = 4;