-static inline uint32_t _mesa_key_hash_string(const void *key)
-{
- return _mesa_hash_string((const char *)key);
-}
+struct hash_table *
+_mesa_pointer_hash_table_create(void *mem_ctx);
+
+/**
+ * This foreach function is safe against deletion (which just replaces
+ * an entry's data with the deleted marker), but not against insertion
+ * (which may rehash the table, making entry a dangling pointer).
+ */
+#define hash_table_foreach(ht, entry) \
+ for (struct hash_entry *entry = _mesa_hash_table_next_entry(ht, NULL); \
+ entry != NULL; \
+ entry = _mesa_hash_table_next_entry(ht, entry))