From: H.G. Muller Date: Wed, 11 Jan 2012 15:20:17 +0000 (+0100) Subject: Fix re-allocation of PGN-cache memory X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=faf295a6b4e7a09ae9214bf1ec4df2062b6a47ee;p=xboard.git Fix re-allocation of PGN-cache memory It allocated 8 times too much! --- diff --git a/backend.c b/backend.c index 4c05a05..636a1a5 100644 --- a/backend.c +++ b/backend.c @@ -11218,7 +11218,7 @@ PackGame (Board board) if(movePtr > dataSize) { if(appData.debugMode) fprintf(debugFP, "move-cache overflow, enlarge to %d MB\n", dataSize/128); dataSize *= 8; // increase size by factor 8 (512KB -> 4MB -> 32MB -> 256MB -> 2GB) - if(dataSize) newSpace = (Move*) calloc(8*dataSize + 1000, sizeof(Move)); + if(dataSize) newSpace = (Move*) calloc(dataSize + 1000, sizeof(Move)); if(newSpace) { int i; Move *p = moveDatabase, *q = newSpace;