Add missing functions

This commit is contained in:
Justin Ethier 2021-01-09 08:07:02 -08:00
parent c23041781b
commit 55e3000084
2 changed files with 16 additions and 0 deletions

View file

@ -238,6 +238,13 @@ ck_pr_load_8(const uint8_t *target)
return result;
}
void ck_pr_store_ptr(void *target, void *value)
{
pthread_mutex_lock(&glock);
*(void **)target = value;
pthread_mutex_unlock(&glock);
}
// Simple hashset
@ -274,6 +281,14 @@ simple_hashset_t simple_hashset_create()
return set;
}
void simple_hashset_destroy(simple_hashset_t set)
{
if (set) {
free(set->items);
}
free(set);
}
void simple_hashset_set_hash_function(simple_hashset_t set, hash_func_t func)
{
set->hash_func = func;

View file

@ -236,4 +236,5 @@ ck_pr_load_int(const int *target);
uint8_t
ck_pr_load_8(const uint8_t *target);
void ck_pr_store_ptr(void *target, void *value);
#endif /* CYCLONE_CK_POLYFILL_H */