X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fsorter%2Fs-internal.h;h=8cb869fcee02c6259078a0f747420185c83fd861;hb=4d9bc7b7d4159cc0c59e608d64a1289b1ac3b45a;hp=0c39613d45c8642c8fd1186dd5da69ad795b31f3;hpb=8b05e3f75ec24156ece10019008ee166c61cdda5;p=libucw.git 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