From 90f06f358b8189b7a9c638014e1961fbea70c92f Mon Sep 17 00:00:00 2001 From: William Irwin Date: Mon, 26 Mar 2012 23:26:44 +0000 Subject: [PATCH] Manually convert tail recursion to iteration in ck_ht_get_spmc(). Signed-off-by: Samy Al Bahra --- src/ck_ht.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ck_ht.c b/src/ck_ht.c index cf1b146..0cba532 100644 --- a/src/ck_ht.c +++ b/src/ck_ht.c @@ -468,6 +468,7 @@ ck_ht_get_spmc(ck_ht_t *table, struct ck_ht_map *map; uint64_t d, d_prime; +restart: map = ck_pr_load_ptr(&table->map); d = ck_pr_load_64(&map->deletions); @@ -487,7 +488,7 @@ ck_ht_get_spmc(ck_ht_t *table, * (K, V), (K', V') and (T, V). Restart load operation in face * of concurrent deletions. */ - return ck_ht_get_spmc(table, h, entry); + goto restart; } if (candidate == NULL || snapshot.key == CK_HT_KEY_EMPTY)