ck_hs: Add ck_hs_rebuild operation.

This operation is short-hand notation for rebuilding
a hash table. This rebuild can occur in the presence
of concurrent readers and will require twice the amount
of memory of the existing hash table until completion.
ck_pring
Samy Al Bahra 11 years ago
parent 25873e2641
commit 5d4f9ae23d

@ -123,6 +123,7 @@ bool ck_hs_set(ck_hs_t *, unsigned long, const void *, void **);
bool ck_hs_fas(ck_hs_t *, unsigned long, const void *, void **);
void *ck_hs_remove(ck_hs_t *, unsigned long, const void *);
bool ck_hs_grow(ck_hs_t *, unsigned long);
bool ck_hs_rebuild(ck_hs_t *);
unsigned long ck_hs_count(ck_hs_t *);
bool ck_hs_reset(ck_hs_t *);
bool ck_hs_reset_size(ck_hs_t *, unsigned long);

@ -366,6 +366,13 @@ restart:
return true;
}
bool
ck_hs_rebuild(struct ck_hs *hs)
{
return ck_hs_grow(hs, hs->map->capacity);
}
static void **
ck_hs_map_probe(struct ck_hs *hs,
struct ck_hs_map *map,

Loading…
Cancel
Save