X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fsorter%2Fcommon.h;h=52949657ad411c2face099d6d3b4fd0b4ea85d36;hb=e65a1a48088af1a5731f64b50ba933f4c29d5040;hp=74e648d62c0b4e40923a5e162a3a77bca9b9c22a;hpb=889bb33b738e79732f3fb1ca79b361ac0375aa76;p=libucw.git diff --git a/lib/sorter/common.h b/lib/sorter/common.h index 74e648d6..52949657 100644 --- a/lib/sorter/common.h +++ b/lib/sorter/common.h @@ -24,6 +24,7 @@ enum sort_debug { SORT_DEBUG_NO_PRESORT = 1, SORT_DEBUG_NO_JOIN = 2, SORT_DEBUG_KEEP_BUCKETS = 4, + SORT_DEBUG_NO_RADIX = 8, }; struct sort_bucket; @@ -32,6 +33,7 @@ struct sort_context { struct fastbuf *in_fb; struct fastbuf *out_fb; uns hash_bits; + u64 in_size; struct mempool *pool; clist bucket_list; @@ -45,10 +47,15 @@ struct sort_context { // Two-way split/merge: merge up to 2 source buckets to up to 2 destination buckets. // Bucket arrays are NULL-terminated. void (*twoway_merge)(struct sort_context *ctx, struct sort_bucket **ins, struct sort_bucket **outs); + // Radix split according to hash function + void (*radix_split)(struct sort_context *ctx, struct sort_bucket *in, struct sort_bucket **outs, uns bitpos, uns numbits); // State variables of internal_sort void *key_buf; int more_keys; + + // Timing + u64 start_time; }; void sorter_run(struct sort_context *ctx);