Allow up to 1GB hash
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 7 Feb 2017 20:57:25 +0000 (21:57 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 7 Feb 2017 20:59:40 +0000 (21:59 +0100)
Previously 256MB was the maximum.

dropper.c

index 3655bd6..0ba2078 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1572,9 +1572,9 @@ SetMemorySize (int n)
   if(n == oldSize) return 0;       // nothing to do
   oldSize = n;                     // remember current size
   if(hashTable) free(hashTable);   // throw away old table
-  for(hashMask = (1<<24)-1; hashMask*sizeof(HashEntry) > n*1024*1024; hashMask >>= 1);    // round down nr of buckets to power of 2
+  for(hashMask = (1<<26)-1; hashMask*sizeof(HashEntry) > n*1024*1024; hashMask >>= 1);    // round down nr of buckets to power of 2
   hashTable = (HashEntry*) calloc(hashMask+4, sizeof(HashEntry));
-printf("# memory allocated\n");
+printf("# memory allocated, mask = %x\n", hashMask+1);
   return !hashTable;               // return TRUE if alocation failed
 }