From: Pavel Charvat Date: Thu, 27 Sep 2007 04:53:50 +0000 (+0200) Subject: sorter: fixed the previous bugfix... all tests now pass X-Git-Tag: holmes-import~506^2~10^2 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=dac398f0e5a61c8c36bd4d3470e54e90acfee13a;p=libucw.git sorter: fixed the previous bugfix... all tests now pass --- diff --git a/lib/sorter/s-internal.h b/lib/sorter/s-internal.h index 0c39613d..8cb869fc 100644 --- a/lib/sorter/s-internal.h +++ b/lib/sorter/s-internal.h @@ -137,7 +137,7 @@ static int P(internal)(struct sort_context *ctx, struct sort_bucket *bin, struct #endif uns dsize = SORT_DATA_SIZE(key); uns recsize = ALIGN_TO(ksize_aligned + dsize, CPU_STRUCT_ALIGN); - size_t totalsize = recsize + 2 * P(internal_workspace)(&key); + size_t totalsize = recsize + sizeof(P(internal_item_t)) + P(internal_workspace)(&key); if (unlikely(totalsize > remains #ifdef CPU_64BIT_POINTERS || item >= item_array + ~0U // The number of items must fit in an uns