X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fsorter%2Fs-internal.h;h=8cb869fcee02c6259078a0f747420185c83fd861;hb=aafbea40b7613274180c8bab60012a0322f8d7dd;hp=3a7107fe41767679e93d820f0656e568fcc2bfd8;hpb=09108be37909fd087b301c221881fd11601e88b5;p=libucw.git diff --git a/lib/sorter/s-internal.h b/lib/sorter/s-internal.h index 3a7107fe..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 + sizeof(P(internal_item_t) *) + 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 @@ -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);