From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id D5F4B3835E25; Fri, 9 Dec 2022 12:21:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5F4B3835E25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670588495; bh=GkOK0R4U2GmAByHZ0eQi+FSoK4gAlUZCjK12t0x5LXU=; h=From:To:Subject:Date:From; b=v2mQmGJVcL9GdEcJHtl0nNcfoFOauOKsS1GLkGppgI8U31HE+x1ZjhffJ1PLTk/w+ fDnHkFjmQqpUmZRJH6mVR4wIWBQzOcV87HrX/4QrQixSM0DxlmHrDwrDm+d4orJ2Xc 3evFh4XKBbM+KEicC2uk3R8k8jbNPDii0d0VkC/0= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] aarch64: morello: malloc: better lookup table resize logic X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: 1861652b2ee82eda7d466ae582d195b3b0dae116 X-Git-Newrev: 7701243cceeaeabc0852fb20ad80f17389cb1921 Message-Id: <20221209122135.D5F4B3835E25@sourceware.org> Date: Fri, 9 Dec 2022 12:21:35 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7701243cceeaeabc0852fb20ad80f17389cb1921 commit 7701243cceeaeabc0852fb20ad80f17389cb1921 Author: Szabolcs Nagy Date: Wed Nov 30 13:09:42 2022 +0000 aarch64: morello: malloc: better lookup table resize logic Capability narrowing uses a lookup table and the old logic could cause unnecessary resizes after deletes with the smallest lookup table size. Diff: --- sysdeps/aarch64/morello/libc-cap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/aarch64/morello/libc-cap.h b/sysdeps/aarch64/morello/libc-cap.h index 19ccc47ada..3549a6db6d 100644 --- a/sysdeps/aarch64/morello/libc-cap.h +++ b/sysdeps/aarch64/morello/libc-cap.h @@ -173,7 +173,7 @@ ht_reserve (struct ht *ht) size_t future_used = ht->used + ht->reserve; /* Resize at 3/4 fill or if there are many deleted entries. */ if (future_fill > ht->mask - ht->mask / 4 - || future_fill > future_used * 4) + || future_fill > 2 * future_used + ht->mask / 4) r = ht_resize (ht); if (!r) ht->reserve--;