From: Pavel Charvat Date: Wed, 26 Sep 2007 07:04:22 +0000 (+0200) Subject: Fixed buggy switching of buffers in the internal sorter. X-Git-Tag: holmes-import~506^2~10^2~4 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c8ca82c11892f8ed331c764a1065abe23bb2f662;p=libucw.git Fixed buggy switching of buffers in the internal sorter. --- diff --git a/lib/sorter/s-fixint.h b/lib/sorter/s-fixint.h index c8a2b991..b3c712bc 100644 --- a/lib/sorter/s-fixint.h +++ b/lib/sorter/s-fixint.h @@ -77,6 +77,8 @@ static int P(internal)(struct sort_context *ctx, struct sort_bucket *bin, struct , workspace, bin->hash_bits #endif ); + if ((void *)buf != ctx->big_buf) + workspace = ctx->big_buf; ctx->total_int_time += get_timer(&timer); SORT_XTRACE(5, "s-fixint: Writing"); diff --git a/lib/sorter/s-internal.h b/lib/sorter/s-internal.h index 3a7107fe..35ba1f50 100644 --- a/lib/sorter/s-internal.h +++ b/lib/sorter/s-internal.h @@ -177,6 +177,8 @@ static int P(internal)(struct sort_context *ctx, struct sort_bucket *bin, struct , workspace, bin->hash_bits #endif ); + if ((void *)item_array != ctx->big_buf) + workspace = ctx->big_buf; last_item = item_array + count; ctx->total_int_time += get_timer(&timer);