From 7701243cceeaeabc0852fb20ad80f17389cb1921 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 30 Nov 2022 13:09:42 +0000 Subject: 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. --- 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--; -- cgit v1.2.1