Go to the documentation of this file.
17 static void hashmap_rehash_cluster(
t_hashmap *hm,
size_t start)
22 while (hm->
keys[start] != NULL)
24 key = hm->
keys[start];
25 val = hm->
vals[start];
26 hm->
keys[start] = NULL;
27 hm->
vals[start] = NULL;
43 if (hm->
keys[i] == NULL)
56 hashmap_rehash_cluster(hm, i + 1);
void hashmap_remove(t_hashmap *hm, const void *key)
Removed the element associated with the specified key from the map.
#define HASHMAP_INIT_CAPACITY
The default initial capacity of a newly initialized hashmap.
const t_type * key_type
The type of keys in the hashmap.
void hashmap_put(t_hashmap *hm, const void *key, const void *val)
Adds a key-value pair to the symbol table.
size_t size
The number of elements in the hashmap.
int(* cmp)(const void *, const void *)
(optional) A function ponter used to compare members of this data type
size_t(* hash)(const void *, size_t)
(optional) A function pointer used to get a hash value of this data type
A symbol table of generic key-value pairs, implemented as a dynamically resizing linear-probing hashm...
void(* del)(void *)
A function pointer used to free the memory taken by the data type.
const t_type * val_type
The type of values in the hashmap.
size_t capacity
The current capacity of the hashmap.