]> mj.ucw.cz Git - libucw.git/commitdiff
Fixed buggy switching of buffers in the internal sorter.
authorPavel Charvat <pavel.charvat@netcentrum.cz>
Wed, 26 Sep 2007 07:04:22 +0000 (09:04 +0200)
committerPavel Charvat <pavel.charvat@netcentrum.cz>
Wed, 26 Sep 2007 07:04:22 +0000 (09:04 +0200)
lib/sorter/s-fixint.h
lib/sorter/s-internal.h

index c8a2b9917659e0432c51aa6837665b25534bde99..b3c712bc936e0d41197d9ea792fcfe174c3f65b6 100644 (file)
@@ -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");
index 3a7107fe41767679e93d820f0656e568fcc2bfd8..35ba1f50dde6ab00ddb1c98495f5900c5ebf542f 100644 (file)
@@ -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);