X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fsorter%2Fcommon.h;h=b4b24ab865af01890d71552d368f702a47750389;hb=7655410e375db3119510775c544b56987ee4bbf8;hp=db414dd08c6c033e99124ce00b373b68997a3881;hpb=5a78c3505ae7fa76a061e26676450049ec5946d5;p=libucw.git diff --git a/lib/sorter/common.h b/lib/sorter/common.h index db414dd0..b4b24ab8 100644 --- a/lib/sorter/common.h +++ b/lib/sorter/common.h @@ -26,6 +26,7 @@ enum sort_debug { SORT_DEBUG_NO_JOIN = 2, SORT_DEBUG_KEEP_BUCKETS = 4, SORT_DEBUG_NO_RADIX = 8, + SORT_DEBUG_NO_MULTIWAY = 16, }; struct sort_bucket; @@ -54,6 +55,9 @@ struct sort_context { // Bucket arrays are NULL-terminated. void (*twoway_merge)(struct sort_context *ctx, struct sort_bucket **ins, struct sort_bucket **outs); + // Multi-way merge: merge an arbitrary number of source buckets to a single destination bucket. + void (*multiway_merge)(struct sort_context *ctx, struct sort_bucket **ins, struct sort_bucket *out); + // 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); @@ -108,6 +112,5 @@ sh_off_t sbuck_size(struct sort_bucket *b); struct fastbuf *sbuck_read(struct sort_bucket *b); struct fastbuf *sbuck_write(struct sort_bucket *b); void sbuck_swap_out(struct sort_bucket *b); -void format_size(byte *buf, u64 x); #endif