diff options
author | W. Felix Handte <w@felixhandte.com> | 2018-02-02 16:41:11 (GMT) |
---|---|---|
committer | W. Felix Handte <w@felixhandte.com> | 2018-03-12 18:58:43 (GMT) |
commit | d6a3024dbb6375190e6e02ad8b06aae28e76b946 (patch) | |
tree | c99d17241fffde37f1765b87b3b0053c79f4b5bf /lib/lz4.h | |
parent | f34fb3c42dbb824af97800eefdb487dff31e0c13 (diff) | |
download | lz4-d6a3024dbb6375190e6e02ad8b06aae28e76b946.zip lz4-d6a3024dbb6375190e6e02ad8b06aae28e76b946.tar.gz lz4-d6a3024dbb6375190e6e02ad8b06aae28e76b946.tar.bz2 |
Add LZ4_compress_fast_safeExtState Function
Diffstat (limited to 'lib/lz4.h')
-rw-r--r-- | lib/lz4.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -179,13 +179,21 @@ LZ4LIB_API int LZ4_compress_fast (const char* src, char* dst, int srcSize, int d /*! +LZ4_compress_fast_safeExtState() : LZ4_compress_fast_extState() : Same compression function, just using an externally allocated memory space to store compression state. Use LZ4_sizeofState() to know how much memory must be allocated, and allocate it on 8-bytes boundaries (using malloc() typically). Then, provide it as 'void* state' to compression function. + + Use _safeExtState variant if LZ4_resetStream() was called on the state + buffer before being used for the first time (calls to this function leave + the state in a safe state, so zeroing is not required between calls). + Otherwise, using legacy _extState requires LZ4 to reinitialize the state + internally for every call. */ LZ4LIB_API int LZ4_sizeofState(void); +LZ4LIB_API int LZ4_compress_fast_safeExtState (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); LZ4LIB_API int LZ4_compress_fast_extState (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); |