These combinations are common enough and deserve a shortcut.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Eric Engestrom <eric@engestrom.ch>
return a == b;
}
+/**
+ * Helper to create a hash table with pointer keys.
+ */
+struct hash_table *
+_mesa_pointer_hash_table_create(void *mem_ctx)
+{
+ return _mesa_hash_table_create(mem_ctx, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
+}
+
/**
* Hash table wrapper which supports 64-bit keys.
*
return (uint32_t) ((num >> 2) ^ (num >> 6) ^ (num >> 10) ^ (num >> 14));
}
+struct hash_table *
+_mesa_pointer_hash_table_create(void *mem_ctx);
+
enum {
_mesa_fnv32_1a_offset_bias = 2166136261u,
};
#include <assert.h>
#include <string.h>
+#include "hash_table.h"
#include "macros.h"
#include "ralloc.h"
#include "set.h"
return NULL;
}
+
+/**
+ * Helper to create a set with pointer keys.
+ */
+struct set *
+_mesa_pointer_set_create(void *mem_ctx)
+{
+ return _mesa_set_create(mem_ctx, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
+}
_mesa_set_random_entry(struct set *set,
int (*predicate)(struct set_entry *entry));
+struct set *
+_mesa_pointer_set_create(void *mem_ctx);
+
/**
* This foreach function is safe against deletion, but not against
* insertion (which may rehash the set, making entry a dangling