X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=rculfhash.c;fp=rculfhash.c;h=c808656947b966ca881538ed2cbf149deaf2ca24;hb=3755ebfd3f0200068efa42fa0ce3162c1ff9c649;hp=a997117f44548835442c78719bc95499fba3e0b9;hpb=a09d9e1e4714e75eb6b9870036bd1932da82f7c6;p=userspace-rcu.git diff --git a/rculfhash.c b/rculfhash.c index a997117..c808656 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -1188,7 +1188,10 @@ void partition_resize_helper(struct cds_lfht *ht, unsigned long i, } partition_len = len >> cds_lfht_get_count_order_ulong(nr_threads); work = calloc(nr_threads, sizeof(*work)); - assert(work); + if (!work) { + dbg_printf("error allocating for resize, single-threading\n"); + goto fallback; + } for (thread = 0; thread < nr_threads; thread++) { work[thread].ht = ht; work[thread].i = i; @@ -1204,6 +1207,11 @@ void partition_resize_helper(struct cds_lfht *ht, unsigned long i, assert(!ret); } free(work); + return; +fallback: + ht->flavor->thread_online(); + fct(ht, i, 0, len); + ht->flavor->thread_offline(); } /*