Manually convert tail recursion to iteration in ck_ht_grow_spmc().

Signed-off-by: Samy Al Bahra <sbahra@repnop.org>
ck_pring
William Irwin 13 years ago committed by Samy Al Bahra
parent 90f06f358b
commit 99f2454646

@ -338,6 +338,7 @@ ck_ht_grow_spmc(ck_ht_t *table, uint64_t capacity)
size_t k, i, j, offset;
uint64_t probes;
restart:
map = table->map;
if (map->capacity >= capacity)
@ -398,7 +399,8 @@ ck_ht_grow_spmc(ck_ht_t *table, uint64_t capacity)
* larger.
*/
ck_ht_map_destroy(update, false);
return ck_ht_grow_spmc(table, capacity << 1);
capacity <<= 1;
goto restart;
}
}

Loading…
Cancel
Save