Cleanups:
o Clean up data types and make sure they cannot overflow. (size_t vs. u64 vs. sh_off_t vs. uns)
+o Clean up log levels.
+o Clean up introductory comments.
o Log messages should show both original and new size of the data. The speed
should be probably calculated from the former.
o Automatically tune ASORT_MIN_RADIX, ASORT_MIN_SHIFT and especially ASORT_RADIX_BITS.
-o Check undefs in sorter.h and array.h.
Improvements:
o Switching between direct and normal I/O. Should use normal I/O if the input is small enough.
* ASORT_PREFIX(x) [*] add a name prefix (used on all global names
* defined by the sorter)
* ASORT_KEY_TYPE [*] data type of a single array entry key
- * ASORT_LT(x,y) x < y for ASORT_TYPE (default: "x<y")
+ * ASORT_LT(x,y) x < y for ASORT_KEY_TYPE (default: "x<y")
* ASORT_HASH(x) a monotone hash function (safisfying hash(x) < hash(y) => x<y)
* ASORT_LONG_HASH hashes are 64-bit numbers (default is 32 bits)
*
return ctx.array;
}
-/* FIXME */
-#undef ASORT_PREFIX
+#undef ASORT_HASH
#undef ASORT_KEY_TYPE
+#undef ASORT_LONG_HASH
#undef ASORT_LT
-#undef ASORT_SWAP
-#undef ASORT_THRESHOLD
#undef ASORT_PAGE_ALIGNED
-#undef ASORT_HASH
+#undef ASORT_PREFIX
#undef ASORT_RADIX_BITS
#undef ASORT_RADIX_MASK
-#undef ASORT_LONG_HASH
+#undef ASORT_SWAP
+#undef ASORT_THRESHOLD
#undef Q
void *buffer; // Auxiliary buffer (required when radix-sorting)
uns num_elts; // Number of elements in the array
uns elt_size; // Bytes per element
- uns hash_bits; // Remaining bits of hash function
+ uns hash_bits; // Remaining bits of the hash function
uns radix_bits; // How many bits to process in a single radix-sort pass
void (*quicksort)(void *array_ptr, uns num_elts);
void (*quicksplit)(void *array_ptr, uns num_elts, int *leftp, int *rightp);
return ctx.out_fb;
}
-#undef SORT_PREFIX
-#undef SORT_KEY
-#undef SORT_KEY_REGULAR
-#undef SORT_KEY_SIZE
+#undef SORT_ASSERT_UNIQUE
#undef SORT_DATA_SIZE
-#undef SORT_VAR_KEY
-#undef SORT_VAR_DATA
-#undef SORT_INT
-#undef SORT_INT64
+#undef SORT_DELETE_INPUT
#undef SORT_HASH_BITS
-#undef SORT_UNIFY
-#undef SORT_UNIFY_WORKSPACE
-#undef SORT_INPUT_FILE
#undef SORT_INPUT_FB
+#undef SORT_INPUT_FILE
+#undef SORT_INPUT_PIPE
#undef SORT_INPUT_PRESORT
-#undef SORT_OUTPUT_FILE
+#undef SORT_INT
+#undef SORT_INT64
+#undef SORT_INTERNAL_RADIX
+#undef SORT_KEY
+#undef SORT_KEY_REGULAR
+#undef SORT_KEY_SIZE
+#undef SORT_LONG_HASH
#undef SORT_OUTPUT_FB
+#undef SORT_OUTPUT_FILE
#undef SORT_OUTPUT_THIS_FB
+#undef SORT_PREFIX
+#undef SORT_UNIFY
+#undef SORT_UNIFY_WORKSPACE
#undef SORT_UNIQUE
-#undef SORT_ASSERT_UNIQUE
-#undef SORT_DELETE_INPUT
-#undef SORT_INTERNAL_RADIX
-#undef SORT_LONG_HASH
+#undef SORT_VAR_DATA
+#undef SORT_VAR_KEY
#undef SWAP
#undef LESS
#undef P
-/* FIXME: Check that we undef everything we should. */