diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2022-11-30 13:09:42 +0000 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2022-12-08 17:41:46 +0000 |
commit | 7701243cceeaeabc0852fb20ad80f17389cb1921 (patch) | |
tree | 88fd927cf09a755e351b368c528a66354a9e4bdf | |
parent | 1861652b2ee82eda7d466ae582d195b3b0dae116 (diff) | |
download | glibc-7701243cceeaeabc0852fb20ad80f17389cb1921.tar.gz |
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.
-rw-r--r-- | sysdeps/aarch64/morello/libc-cap.h | 2 |
1 files changed, 1 insertions, 1 deletions
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--; |