From 5e5a48ff8cd08f123601cd0625ca62a86675aac9 Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 4 Jan 2015 16:25:32 +0100 Subject: fontconfig libX11 mesa xserver git update 4 Jan 2015 xserver commit dc777c346d5d452a53b13b917c45f6a1bad2f20b libX11 commit 446f5f7f41317a85a0cd0efa5e6a1b37bc99fba2 fontconfig commit 4420b27c074821a1d1f9d6ebe822a610176a417d mesa commit 48094d0e6554a9df36bf00fc2793ade46cf92406 --- mesalib/src/mesa/main/hash.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'mesalib/src/mesa/main/hash.c') diff --git a/mesalib/src/mesa/main/hash.c b/mesalib/src/mesa/main/hash.c index 52095f7d1..a8c796b9a 100644 --- a/mesalib/src/mesa/main/hash.c +++ b/mesalib/src/mesa/main/hash.c @@ -96,6 +96,12 @@ uint_hash(GLuint id) return id; } +static uint32_t +uint_key_hash(const void *key) +{ + return uint_hash((uintptr_t)key); +} + static void * uint_key(GLuint id) { @@ -114,7 +120,8 @@ _mesa_NewHashTable(void) struct _mesa_HashTable *table = CALLOC_STRUCT(_mesa_HashTable); if (table) { - table->ht = _mesa_hash_table_create(NULL, uint_key_compare); + table->ht = _mesa_hash_table_create(NULL, uint_key_hash, + uint_key_compare); if (table->ht == NULL) { free(table); _mesa_error_no_memory(__func__); @@ -175,7 +182,7 @@ _mesa_HashLookup_unlocked(struct _mesa_HashTable *table, GLuint key) if (key == DELETED_KEY_VALUE) return table->deleted_key_data; - entry = _mesa_hash_table_search(table->ht, uint_hash(key), uint_key(key)); + entry = _mesa_hash_table_search(table->ht, uint_key(key)); if (!entry) return NULL; @@ -266,11 +273,11 @@ _mesa_HashInsert_unlocked(struct _mesa_HashTable *table, GLuint key, void *data) if (key == DELETED_KEY_VALUE) { table->deleted_key_data = data; } else { - entry = _mesa_hash_table_search(table->ht, hash, uint_key(key)); + entry = _mesa_hash_table_search_pre_hashed(table->ht, hash, uint_key(key)); if (entry) { entry->data = data; } else { - _mesa_hash_table_insert(table->ht, hash, uint_key(key), data); + _mesa_hash_table_insert_with_hash(table->ht, hash, uint_key(key), data); } } } @@ -340,7 +347,7 @@ _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key) if (key == DELETED_KEY_VALUE) { table->deleted_key_data = NULL; } else { - entry = _mesa_hash_table_search(table->ht, uint_hash(key), uint_key(key)); + entry = _mesa_hash_table_search(table->ht, uint_key(key)); _mesa_hash_table_remove(table->ht, entry); } mtx_unlock(&table->Mutex); -- cgit v1.2.3