aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_debug_refcnt.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-02-05 14:10:48 -0500
committerMarge Bot <[email protected]>2020-02-26 20:35:50 +0000
commita01a875081bd52bc1c3c142a60af678171ce6c33 (patch)
tree395290b39796f09ee465fda4fbbb07354c57cb26 /src/gallium/auxiliary/util/u_debug_refcnt.c
parent56f31328f207f310ee9b53f3294a23b25b2687e0 (diff)
gallium/hash_table: consolidate hash tables with pointer keys
Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
Diffstat (limited to 'src/gallium/auxiliary/util/u_debug_refcnt.c')
-rw-r--r--src/gallium/auxiliary/util/u_debug_refcnt.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/gallium/auxiliary/util/u_debug_refcnt.c b/src/gallium/auxiliary/util/u_debug_refcnt.c
index ec95f87260c..c1560fb7dc0 100644
--- a/src/gallium/auxiliary/util/u_debug_refcnt.c
+++ b/src/gallium/auxiliary/util/u_debug_refcnt.c
@@ -58,25 +58,6 @@ static struct util_hash_table *serials_hash;
static unsigned serials_last;
-static unsigned
-hash_ptr(void *p)
-{
- return (unsigned) (uintptr_t) p;
-}
-
-
-static int
-compare_ptr(void *a, void *b)
-{
- if (a == b)
- return 0;
- else if (a < b)
- return -1;
- else
- return 1;
-}
-
-
/**
* Return a small integer serial number for the given pointer.
*/
@@ -96,7 +77,7 @@ debug_serial(void *p, unsigned *pserial)
mtx_lock(&serials_mutex);
if (!serials_hash)
- serials_hash = util_hash_table_create(hash_ptr, compare_ptr);
+ serials_hash = util_hash_table_create_ptr_keys();
serial = (unsigned) (uintptr_t) util_hash_table_get(serials_hash, p);
if (!serial) {