]> mj.ucw.cz Git - libucw.git/blobdiff - lib/sorter/govern.c
Created a local TODO list.
[libucw.git] / lib / sorter / govern.c
index 8380f926572a21f1fc3cf5eb25d186d925569a08..1211a81cfe55e912d87c1b9fab4bfb875681f4bd 100644 (file)
@@ -177,7 +177,7 @@ sorter_radix_bits(struct sort_context *ctx, struct sort_bucket *b)
     return 0;
 
   u64 in = sbuck_size(b);
-  u64 mem = ctx->internal_estimate(ctx, b);
+  u64 mem = ctx->internal_estimate(ctx, b) * 0.8;      // FIXME: Magical factor for hash non-uniformity
   if (in <= mem)
     return 0;
 
@@ -228,8 +228,6 @@ sorter_run(struct sort_context *ctx)
   clist_init(&ctx->bucket_list);
   sorter_prepare_buf(ctx);
 
-  /* FIXME: Remember to test sorting of empty files */
-
   // Create bucket containing the source
   struct sort_bucket *bin = sbuck_new(ctx);
   bin->flags = SBF_SOURCE | SBF_OPEN_READ;
@@ -238,7 +236,7 @@ sorter_run(struct sort_context *ctx)
   else
     bin->fb = ctx->in_fb;
   bin->ident = "in";
-  bin->size = ctx->in_size;            /* FIXME: Sizes should be either sh_off_t or u64, not both; beware of ~0U */
+  bin->size = ctx->in_size;
   bin->hash_bits = ctx->hash_bits;
   clist_add_tail(&ctx->bucket_list, &bin->n);
   SORT_XTRACE(2, "Input size: %s", F_BSIZE(bin));