diff options
author | yann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd> | 2013-07-27 11:19:31 (GMT) |
---|---|---|
committer | yann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd> | 2013-07-27 11:19:31 (GMT) |
commit | 13e966d9686de41c428e4e83e87e9255016cd9a6 (patch) | |
tree | c86629df568bbb3cfd9791bb510134d751d8391d /bench.c | |
parent | 002a93473db38e83fd309aead9567da4aba6834f (diff) | |
download | lz4-13e966d9686de41c428e4e83e87e9255016cd9a6.zip lz4-13e966d9686de41c428e4e83e87e9255016cd9a6.tar.gz lz4-13e966d9686de41c428e4e83e87e9255016cd9a6.tar.bz2 |
lz4c : made display and arguments more compatible with gzip, for easier integration with tar (patch by Yaakov Selkowitz)
Correction : large files support on 32-bits unix (reported by Karthik Rajeswaran)
lz4c : reduce the amount of displayed information in default mode; introduce a verbose mode
lz4c : changed help message
Updated xxHash to r31
Made bench.c compatible with tcc
Corrected : a few minor warnings found by CppCheck, as suggested by Brian White
lz4.c : Pushed BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE farther in the code, since it is reported as providing little benefit
Corrected : minor 64K input condition, detected by Mat Hostetter
git-svn-id: https://lz4.googlecode.com/svn/trunk@99 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
Diffstat (limited to 'bench.c')
-rw-r--r-- | bench.c | 30 |
1 files changed, 20 insertions, 10 deletions
@@ -30,24 +30,18 @@ #define _CRT_SECURE_NO_DEPRECATE // VS2005
// Unix Large Files support (>4GB)
+#define _FILE_OFFSET_BITS 64
#if (defined(__sun__) && (!defined(__LP64__))) // Sun Solaris 32-bits requires specific definitions
# define _LARGEFILE_SOURCE
-# define _FILE_OFFSET_BITS 64
#elif ! defined(__LP64__) // No point defining Large file for 64 bit
# define _LARGEFILE64_SOURCE
#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,19 @@ //**************************************
+// Compiler specifics
+//**************************************
+#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
@@ -153,6 +160,7 @@ void BMK_SetPause() BMK_pause = 1;
}
+
//*********************************************************
// Private functions
//*********************************************************
@@ -300,11 +308,12 @@ int BMK_benchFile(char** fileNamesTable, int nbFiles, int cLevel) compressed_buff = (char*)malloc((size_t )compressed_buff_size);
- if(!orig_buff || !compressed_buff)
+ if (!orig_buff || !compressed_buff)
{
DISPLAY("\nError: not enough memory!\n");
free(orig_buff);
free(compressed_buff);
+ free(chunkP);
fclose(fileIn);
return 12;
}
@@ -330,11 +339,12 @@ int BMK_benchFile(char** fileNamesTable, int nbFiles, int cLevel) readSize = fread(orig_buff, 1, benchedSize, fileIn);
fclose(fileIn);
- if(readSize != benchedSize)
+ if (readSize != benchedSize)
{
DISPLAY("\nError: problem reading file '%s' !! \n", infilename);
free(orig_buff);
free(compressed_buff);
+ free(chunkP);
return 13;
}
|