public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
* [2.25 COMMITTED] __libc_dynarray_emplace_enlarge: Add missing else
@ 2018-01-01  0:00 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2018-01-01  0:00 UTC (permalink / raw)
  To: libc-stable

Before, arrays of small elements received a starting allocation size of
8, not 16.

(cherry picked from commit ab5ac271e6210fa0af11cf3ca525ce573bc47c48)

2017-09-06  Florian Weimer  <fweimer@redhat.com>

	* malloc/dynarray_emplace_enlarge.c
	(__libc_dynarray_emplace_enlarge): Add missing else.

diff --git a/malloc/dynarray_emplace_enlarge.c b/malloc/dynarray_emplace_enlarge.c
index 0fb032765c..a15245f4cb 100644
--- a/malloc/dynarray_emplace_enlarge.c
+++ b/malloc/dynarray_emplace_enlarge.c
@@ -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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-04 12:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-01  0:00 [2.25 COMMITTED] __libc_dynarray_emplace_enlarge: Add missing else Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).