[Mesa-dev] [PATCH 6/7] util: Use a starting load factor of 7/8 entries

Thomas Helland thomashelland90 at gmail.com
Tue Feb 21 20:53:36 UTC 2017


---
 src/util/hash_table.c | 2 +-
 src/util/set.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/hash_table.c b/src/util/hash_table.c
index e1255a2484..8121c8e67a 100644
--- a/src/util/hash_table.c
+++ b/src/util/hash_table.c
@@ -85,7 +85,7 @@ _mesa_hash_table_create(void *mem_ctx,
 
    ht->size_iteration = 3;
    ht->size = 1 << ht->size_iteration;
-   ht->max_entries = ht->size * 0.9;
+   ht->max_entries = ht->size - 1;
    ht->key_hash_function = key_hash_function;
    ht->key_equals_function = key_equals_function;
    ht->table = rzalloc_array(ht, struct hash_entry, ht->size);
diff --git a/src/util/set.c b/src/util/set.c
index 31014984dc..98b5670834 100644
--- a/src/util/set.c
+++ b/src/util/set.c
@@ -85,7 +85,7 @@ _mesa_set_create(void *mem_ctx,
 
    ht->size_iteration = 3;
    ht->size = 1 << ht->size_iteration;
-   ht->max_entries = ht->size * 0.9;
+   ht->max_entries = ht->size - 1;
    ht->key_hash_function = key_hash_function;
    ht->key_equals_function = key_equals_function;
    ht->table = rzalloc_array(ht, struct set_entry, ht->size);
-- 
2.11.1



More information about the mesa-dev mailing list