public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] aarch64: morello: malloc: better lookup table resize logic
@ 2022-12-09 12:21 Szabolcs Nagy
  0 siblings, 0 replies; only message in thread
From: Szabolcs Nagy @ 2022-12-09 12:21 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7701243cceeaeabc0852fb20ad80f17389cb1921

commit 7701243cceeaeabc0852fb20ad80f17389cb1921
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
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--;

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

only message in thread, other threads:[~2022-12-09 12:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 12:21 [glibc/arm/morello/main] aarch64: morello: malloc: better lookup table resize logic Szabolcs Nagy

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).