From: H.G.Muller Date: Tue, 7 Feb 2017 20:57:25 +0000 (+0100) Subject: Allow up to 1GB hash X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=22059c4c8bcdb3e982406d9c16a7041984450719;p=crazywa.git Allow up to 1GB hash Previously 256MB was the maximum. --- diff --git a/dropper.c b/dropper.c index 3655bd6..0ba2078 100644 --- 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 }