]> mj.ucw.cz Git - libucw.git/commitdiff
Merge with git+ssh://git.ucw.cz/projects/sherlock/GIT/sherlock.git#dev-sorter
authorMartin Mares <mj@ucw.cz>
Fri, 7 Sep 2007 12:33:26 +0000 (14:33 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 7 Sep 2007 12:33:26 +0000 (14:33 +0200)
1  2 
lib/sorter/array.h
lib/sorter/s-fixint.h
lib/sorter/s-internal.h

index 76f108cb181b7aa062658d7ac1eaa13503566809,aa75e05a23e72965c1594e71f1fc67061f397059..aa0e2266f990c2449063b2412b018343a357a71e
   *                    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_THRESHOLD   threshold for switching between quicksort and insertsort
-  *  ASORT_PAGE_ALIGNED        the array is guaranteed to be aligned to a multiple of CPU_PAGE_SIZE  (FIXME: Do we need this?)
   *  ASORT_HASH(x)     a monotone hash function (safisfying hash(x) < hash(y) => x<y)
-  *  ASORT_RADIX_BITS  FIXME
-  *  ASORT_SWAP                FIXME: probably keep private
 + *  ASORT_LONG_HASH   hashes are 64-bit numbers (default is 32 bits)
+  *
+  *  Fine-tuning parameters: (if you really insist)
+  *
+  *  ASORT_THRESHOLD   threshold for switching between quicksort and insertsort
+  *  ASORT_RADIX_BITS  how many bits of the hash functions are to be used at once for
+  *                    radix-sorting.
   *
   *  After including this file, a function
   *    ASORT_KEY_TYPE *ASORT_PREFIX(sort)(ASORT_KEY_TYPE *array, uns num_elts, ASORT_KEY_TYPE *buf, uns hash_bits)
index e2a24b5b2e39065533470039afc232990e79d90a,de152b0a90422d5fae4bd56de7d4c1e9eb68a188..d901a064d34d4881a8393835b90e652b81f37335
  #define ASORT_PREFIX(x) SORT_PREFIX(array_##x)
  #define ASORT_KEY_TYPE P(key)
  #define ASORT_LT(x,y) (P(compare)(&(x), &(y)) < 0)
- #define ASORT_PAGE_ALIGNED
  #ifdef SORT_INTERNAL_RADIX
 -#define ASORT_HASH(x) P(hash)(&(x))
 +#  define ASORT_HASH(x) P(hash)(&(x))
 +#    ifdef SORT_LONG_HASH
 +#      define ASORT_LONG_HASH
 +#    endif
  #endif
  #include "lib/sorter/array.h"
  
index 3e9b55b7d5c68d8b393ccc31e359d81953b0a095,765ed4b9892806855c0d0228261fd61fde038137..e581cecb7443b886b3c6954f9510d194051f3764
@@@ -17,13 -17,6 +17,12 @@@ typedef struct 
  #define ASORT_PREFIX(x) SORT_PREFIX(array_##x)
  #define ASORT_KEY_TYPE P(internal_item_t)
  #define ASORT_LT(x,y) (P(compare)((x).key, (y).key) < 0)
- #define ASORT_PAGE_ALIGNED
 +#ifdef SORT_INTERNAL_RADIX
 +#  define ASORT_HASH(x) P(hash)((x).key)
 +#    ifdef SORT_LONG_HASH
 +#      define ASORT_LONG_HASH
 +#    endif
 +#endif
  #include "lib/sorter/array.h"
  
  /*