summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2015-09-01 14:59:24 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2015-09-01 14:59:24 (GMT)
commitfb6fece7704c7747d008c0afbc79d61671dcb1d6 (patch)
tree4d28c845226443ca5a63db4b0c188fe27023e44d /lib
parent13f12aa0276748e24a7fc8b01e227c68b4d4f56e (diff)
downloadlz4-fb6fece7704c7747d008c0afbc79d61671dcb1d6.zip
lz4-fb6fece7704c7747d008c0afbc79d61671dcb1d6.tar.gz
lz4-fb6fece7704c7747d008c0afbc79d61671dcb1d6.tar.bz2
Updated Makefile and .travis
Diffstat (limited to 'lib')
-rw-r--r--lib/liblz4.pc.in2
-rw-r--r--lib/lz4.c9
-rw-r--r--lib/lz4frame.h30
3 files changed, 24 insertions, 17 deletions
diff --git a/lib/liblz4.pc.in b/lib/liblz4.pc.in
index 0d05152..d9393c7 100644
--- a/lib/liblz4.pc.in
+++ b/lib/liblz4.pc.in
@@ -8,7 +8,7 @@ includedir=@INCLUDEDIR@
Name: lz4
Description: fast lossless compression algorithm library
-URL: http://code.google.com/p/lz4/
+URL: http://lz4.org/
Version: @VERSION@
Libs: -L@LIBDIR@ -llz4
Cflags: -I@INCLUDEDIR@
diff --git a/lib/lz4.c b/lib/lz4.c
index b2d9293..d23d6b9 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -206,7 +206,7 @@ static void LZ4_write16(void* memPtr, U16 value)
memcpy(memPtr, &value, sizeof(value));
}
-#endif // LZ4_FORCE_DIRECT_MEMORY_ACCESS
+#endif // LZ4_FORCE_MEMORY_ACCESS
static U16 LZ4_readLE16(const void* memPtr)
@@ -247,6 +247,13 @@ static void LZ4_wildCopy(void* dstPtr, const void* srcPtr, void* dstEnd)
BYTE* d = (BYTE*)dstPtr;
const BYTE* s = (const BYTE*)srcPtr;
BYTE* const e = (BYTE*)dstEnd;
+
+#if 1
+ const size_t l2 = 8 - (((size_t)d) & (sizeof(void*)-1));
+ LZ4_copy8(d,s); if (d>e-9) return;
+ d+=l2; s+=l2;
+#endif // join to align
+
do { LZ4_copy8(d,s); d+=8; s+=8; } while (d<e);
}
diff --git a/lib/lz4frame.h b/lib/lz4frame.h
index 05fbc5f..47147b7 100644
--- a/lib/lz4frame.h
+++ b/lib/lz4frame.h
@@ -33,8 +33,8 @@
*/
/* LZ4F is a stand-alone API to create LZ4-compressed frames
- * fully conformant to specification v1.5.1.
- * All related operations, including memory management, are handled by the library.
+ * conformant with specification v1.5.1.
+ * All related operations, including memory management, are handled internally by the library.
* You don't need lz4.h when using lz4frame.h.
* */
@@ -51,8 +51,8 @@ extern "C" {
/**************************************
- * Error management
- * ************************************/
+* Error management
+**************************************/
typedef size_t LZ4F_errorCode_t;
unsigned LZ4F_isError(LZ4F_errorCode_t code);
@@ -60,8 +60,8 @@ const char* LZ4F_getErrorName(LZ4F_errorCode_t code); /* return error code str
/**************************************
- * Frame compression types
- * ************************************/
+* Frame compression types
+**************************************/
//#define LZ4F_DISABLE_OBSOLETE_ENUMS
#ifndef LZ4F_DISABLE_OBSOLETE_ENUMS
# define LZ4F_OBSOLETE_ENUM(x) ,x
@@ -126,8 +126,8 @@ typedef struct {
/***********************************
- * Simple compression function
- * *********************************/
+* Simple compression function
+***********************************/
size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr);
size_t LZ4F_compressFrame(void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_preferences_t* preferencesPtr);
@@ -257,15 +257,15 @@ size_t LZ4F_getFrameInfo(LZ4F_decompressionContext_t dctx,
const void* srcBuffer, size_t* srcSizePtr);
/* LZ4F_getFrameInfo()
* This function decodes frame header information (such as max blockSize, frame checksum, etc.).
- * Its usage is optional : you can start by calling directly LZ4F_decompress() instead.
- * The objective is to extract frame header information, typically for allocation purposes.
- * LZ4F_getFrameInfo() can also be used anytime *after* starting decompression, on any valid LZ4F_decompressionContext_t.
- * The result is *copied* into an existing LZ4F_frameInfo_t structure which must be already allocated.
- * The number of bytes read from srcBuffer will be provided within *srcSizePtr (necessarily <= original value).
- * The function result is an hint of how many srcSize bytes LZ4F_decompress() expects for next call,
+ * Its usage is optional. The objective is to extract frame header information, typically for allocation purposes.
+ * A header size is variable and can be from 7 to 15 bytes. It's also possible to input more bytes than that.
+ * The number of bytes read from srcBuffer will be updated within *srcSizePtr (necessarily <= original value).
+ * (note that LZ4F_getFrameInfo() can also be used anytime *after* starting decompression, in this case 0 input byte is enough)
+ * Frame header info is *copied into* an already allocated LZ4F_frameInfo_t structure.
+ * The function result is an hint about how many srcSize bytes LZ4F_decompress() expects for next call,
* or an error code which can be tested using LZ4F_isError()
* (typically, when there is not enough src bytes to fully decode the frame header)
- * You are expected to resume decompression from where it stopped (srcBuffer + *srcSizePtr)
+ * Decompression is expected to resume from where it stopped (srcBuffer + *srcSizePtr)
*/
size_t LZ4F_decompress(LZ4F_decompressionContext_t dctx,