*
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
-#include <stdlib.h>
-#include <string.h>
-
-#include <assert.h>
+#include "main/imports.h"
#include "main/simple_list.h"
#include "hash_table.h"
num_buckets = 16;
}
- ht = _mesa_malloc(sizeof(*ht) + ((num_buckets - 1)
+ ht = malloc(sizeof(*ht) + ((num_buckets - 1)
* sizeof(ht->buckets[0])));
if (ht != NULL) {
ht->hash = hash;
hash_table_dtor(struct hash_table *ht)
{
hash_table_clear(ht);
- _mesa_free(ht);
+ free(ht);
}
for (i = 0; i < ht->num_buckets; i++) {
foreach_s(node, temp, & ht->buckets[i]) {
remove_from_list(node);
- _mesa_free(node);
+ free(node);
}
assert(is_empty_list(& ht->buckets[i]));
const unsigned bucket = hash_value % ht->num_buckets;
struct hash_node *node;
- node = _mesa_calloc(sizeof(*node));
+ node = calloc(1, sizeof(*node));
node->data = data;
node->key = key;