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

Loading…
Cancel
Save