Merge branch 'jc/diff' into next
authorJunio C Hamano <junkio@cox.net>
Mon, 13 Mar 2006 04:42:35 +0000 (20:42 -0800)
committerJunio C Hamano <junkio@cox.net>
Mon, 13 Mar 2006 04:42:35 +0000 (20:42 -0800)
* jc/diff:
diffcore-delta: tweak hashbase value.

diffcore-delta.c
index f8a751837e3e67fef57e3de9670e5a2defc6652a..835d82c9939644faa808bb2f616136549af521db 100644 (file)
 
 /* Wild guess at the initial hash size */
 #define INITIAL_HASH_SIZE 9
-#define HASHBASE 65537 /* next_prime(2^16) */
+
 /* We leave more room in smaller hash but do not let it
  * grow to have unused hole too much.
  */
 #define INITIAL_FREE(sz_log2) ((1<<(sz_log2))*(sz_log2-3)/(sz_log2))
 
+/* A prime rather carefully chosen between 2^16..2^17, so that
+ * HASHBASE < INITIAL_FREE(17).  We want to keep the maximum hashtable
+ * size under the current 2<<17 maximum, which can hold this many
+ * different values before overflowing to hashtable of size 2<<18.
+ */
+#define HASHBASE 107927
+
 struct spanhash {
        unsigned long hashval;
        unsigned long cnt;