This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH COMMITTED] __libc_dynarray_emplace_enlarge: Add missing else
- From: fweimer at redhat dot com (Florian Weimer)
- To: libc-alpha at sourceware dot org
- Date: Wed, 06 Sep 2017 16:06:47 +0200
- Subject: [PATCH COMMITTED] __libc_dynarray_emplace_enlarge: Add missing else
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0D6AE356D3
Before, arrays of small elements received a starting allocation size of
8, not 16.
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;