X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=rculfhash.c;fp=rculfhash.c;h=2a450459f5cfa50e94bce03e00be0ad1be7b2b4f;hp=7d39388f494700a1b06a5df885d5a5350cdf42a8;hb=7c75d49894833089f34b7e71196e60b2ae5979b1;hpb=2c81778bd92008e5c79173788738f1800cd42e8b diff --git a/rculfhash.c b/rculfhash.c index 7d39388..2a45045 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -1189,7 +1189,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; @@ -1205,6 +1208,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(); } /*