summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2015-03-30 17:39:29 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2015-03-30 17:39:29 (GMT)
commit2a826193110e5423e7dedcaa78ddb7c1aa1f0950 (patch)
tree5bf3cd2585192d5351000a2736e49e21ff0d7de0
parent6c69dc176c318fba721fa8adade53f3e413cac52 (diff)
downloadlz4-2a826193110e5423e7dedcaa78ddb7c1aa1f0950.zip
lz4-2a826193110e5423e7dedcaa78ddb7c1aa1f0950.tar.gz
lz4-2a826193110e5423e7dedcaa78ddb7c1aa1f0950.tar.bz2
fixed fullbench memory allocation error
-rw-r--r--programs/fullbench.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/programs/fullbench.c b/programs/fullbench.c
index 0c6e05e..6c42ed0 100644
--- a/programs/fullbench.c
+++ b/programs/fullbench.c
@@ -544,7 +544,7 @@ int fullSpeedBench(char** fileNamesTable, int nbFiles)
return 10;
}
- // Loop for each file
+ /* Loop for each fileName */
while (fileIdx<nbFiles)
{
FILE* inFile;
@@ -559,11 +559,7 @@ int fullSpeedBench(char** fileNamesTable, int nbFiles)
U32 crcOriginal;
- // Init
- stateLZ4 = LZ4_createStream();
- stateLZ4HC = LZ4_createStreamHC();
-
- // Check file existence
+ /* Check file existence */
inFileName = fileNamesTable[fileIdx++];
inFile = fopen( inFileName, "rb" );
if (inFile==NULL)
@@ -572,10 +568,14 @@ int fullSpeedBench(char** fileNamesTable, int nbFiles)
return 11;
}
- // Memory allocation & restrictions
+ /* Init */
+ stateLZ4 = LZ4_createStream();
+ stateLZ4HC = LZ4_createStreamHC();
+
+ /* Memory allocation & restrictions */
inFileSize = BMK_GetFileSize(inFileName);
if (inFileSize==0) { DISPLAY( "file is empty\n"); return 11; }
- benchedSize = (size_t) BMK_findMaxMem(inFileSize) / 2;
+ benchedSize = (size_t) BMK_findMaxMem(inFileSize);
if (benchedSize==0) { DISPLAY( "not enough memory\n"); return 11; }
if ((U64)benchedSize > inFileSize) benchedSize = (size_t)inFileSize;
if (benchedSize < inFileSize)
@@ -940,7 +940,7 @@ _exit_blockProperties:
// Modify Nb Iterations
case 'i':
- if ((argument[1] >='1') && (argument[1] <='9'))
+ if ((argument[1] >='0') && (argument[1] <='9'))
{
int iters = argument[1] - '0';
BMK_SetNbIterations(iters);