Go to the documentation of this file.
17 static void hashset_rehash_cluster(
t_hashset *hs,
size_t start)
21 while (hs->
vals[start] != NULL)
23 val = hs->
vals[start];
24 hs->
vals[start] = NULL;
39 if (hs->
vals[i] == NULL)
50 hashset_rehash_cluster(hs, i + 1);
size_t capacity
The current capacity of the hashset.
void hashset_put(t_hashset *hs, const void *val)
Adds a copy of the specified element to the hashset.
int(* cmp)(const void *, const void *)
(optional) A function ponter used to compare members of this data type
#define HASHSET_INIT_CAPACITY
The default initial capacity of a newly initialized hashset.
size_t(* hash)(const void *, size_t)
(optional) A function pointer used to get a hash value of this data type
void hashset_remove(t_hashset *hs, const void *val)
Removed the specified element from the set.
size_t size
The number of elements in the hashset.
void(* del)(void *)
A function pointer used to free the memory taken by the data type.
A dynamically resizing linear-probing hashset.
const t_type * type
The type of elements in the hashset.