diff options
Diffstat (limited to 'fullbench.c')
-rw-r--r-- | fullbench.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/fullbench.c b/fullbench.c index e64664d..66aa0ed 100644 --- a/fullbench.c +++ b/fullbench.c @@ -38,16 +38,10 @@ #endif
// S_ISREG & gettimeofday() are not supported by MSVC
-#if defined(_MSC_VER)
-# define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
+#if defined(_MSC_VER) || defined(_WIN32)
# define BMK_LEGACY_TIMER 1
#endif
-// GCC does not support _rotl outside of Windows
-#if !defined(_WIN32)
-# define _rotl(x,r) ((x << r) | (x >> (32 - r)))
-#endif
-
//**************************************
// Includes
@@ -74,6 +68,20 @@ //**************************************
+// Compiler Options
+//**************************************
+// S_ISREG & gettimeofday() are not supported by MSVC
+#if !defined(S_ISREG)
+# define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
+#endif
+
+// GCC does not support _rotl outside of Windows
+#if !defined(_WIN32)
+# define _rotl(x,r) ((x << r) | (x >> (32 - r)))
+#endif
+
+
+//**************************************
// Basic Types
//**************************************
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L // C99
@@ -326,6 +334,7 @@ int fullSpeedBench(char** fileNamesTable, int nbFiles) DISPLAY("\nError: not enough memory!\n");
free(orig_buff);
free(compressed_buff);
+ free(chunkP);
fclose(fileIn);
return 12;
}
@@ -356,6 +365,7 @@ int fullSpeedBench(char** fileNamesTable, int nbFiles) DISPLAY("\nError: problem reading file '%s' !! \n", infilename);
free(orig_buff);
free(compressed_buff);
+ free(chunkP);
return 13;
}
@@ -385,7 +395,7 @@ int fullSpeedBench(char** fileNamesTable, int nbFiles) case 1: compressionFunction = local_LZ4_compress_limitedOutput; break;
case 2: compressionFunction = LZ4_compressHC; break;
case 3: compressionFunction = local_LZ4_compressHC_limitedOutput; break;
- default : DISPLAY("ERROR ! Bad algorithm Id !! \n"); return 1;
+ default : DISPLAY("ERROR ! Bad algorithm Id !! \n"); free(chunkP); return 1;
}
for (loopNb = 1; loopNb <= nbIterations; loopNb++)
@@ -449,7 +459,7 @@ int fullSpeedBench(char** fileNamesTable, int nbFiles) case 2: decompressionFunction = LZ4_decompress_safe; break;
case 3: decompressionFunction = LZ4_decompress_safe_withPrefix64k; break;
case 4: decompressionFunction = local_LZ4_decompress_safe_partial; break;
- default : DISPLAY("ERROR ! Bad algorithm Id !! \n"); return 1;
+ default : DISPLAY("ERROR ! Bad algorithm Id !! \n"); free(chunkP); return 1;
}
for (loopNb = 1; loopNb <= nbIterations; loopNb++)
|