From 22059c4c8bcdb3e982406d9c16a7041984450719 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 7 Feb 2017 21:57:25 +0100 Subject: [PATCH] Allow up to 1GB hash Previously 256MB was the maximum. --- dropper.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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 } -- 1.7.0.4