From: Lai Jiangshan Date: Tue, 1 Nov 2011 17:08:13 +0000 (-0400) Subject: rculfhash: Fix min_alloc_size bug X-Git-Tag: v0.7.0~43^2~69 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=bcbd36fc765389927cca53ccab93bbb00c9f0039;p=urcu.git rculfhash: Fix min_alloc_size bug When I change MIN_ALLOC_ORDER macro to parameter, I forgot set min_alloc_order before used it which causes bug. Signed-off-by: Lai Jiangshan Signed-off-by: Mathieu Desnoyers --- diff --git a/rculfhash.c b/rculfhash.c index da37e97..4d37fac 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -1348,10 +1348,10 @@ struct cds_lfht *_cds_lfht_new(cds_lfht_hash_fct hash_fct, pthread_mutex_init(&ht->resize_mutex, NULL); order = get_count_order_ulong(init_size); ht->t.resize_target = 1UL << order; - cds_lfht_create_dummy(ht, 1UL << order); - ht->t.size = 1UL << order; ht->min_alloc_size = min_alloc_size; ht->min_alloc_order = get_count_order_ulong(min_alloc_size); + cds_lfht_create_dummy(ht, 1UL << order); + ht->t.size = 1UL << order; return ht; }