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
}