diff options
author | Yann Collet <cyan@fb.com> | 2019-04-05 19:54:13 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2019-04-05 19:56:26 (GMT) |
commit | 2ece0d83809849e68e9c194ff3d340982b527256 (patch) | |
tree | 2f2692d37b98224bef70a1184c8511555e66b5f2 /lib/lz4frame.c | |
parent | 2a94faf462c53feb864c4ae4e857c4870a948da0 (diff) | |
download | lz4-2ece0d83809849e68e9c194ff3d340982b527256.zip lz4-2ece0d83809849e68e9c194ff3d340982b527256.tar.gz lz4-2ece0d83809849e68e9c194ff3d340982b527256.tar.bz2 |
created LZ4_initStream()
- promoted LZ4_resetStream_fast() to stable
- moved LZ4_resetStream() into deprecate, but without triggering a compiler warning
- update all sources to no longer rely on LZ4_resetStream()
note : LZ4_initStream() proposal is slightly different :
it's able to initialize any buffer, provided that it's large enough.
To this end, it accepts a void*, and returns an LZ4_stream_t*.
Diffstat (limited to 'lib/lz4frame.c')
-rw-r--r-- | lib/lz4frame.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c index f076204..3b4fcee 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -446,7 +446,7 @@ size_t LZ4F_compressFrame(void* dstBuffer, size_t dstCapacity, if (preferencesPtr == NULL || preferencesPtr->compressionLevel < LZ4HC_CLEVEL_MIN) { - LZ4_resetStream(&lz4ctx); + LZ4_initStream(&lz4ctx, sizeof(lz4ctx)); cctxPtr->lz4CtxPtr = &lz4ctx; cctxPtr->lz4CtxAlloc = 1; cctxPtr->lz4CtxState = 1; @@ -628,7 +628,7 @@ size_t LZ4F_compressBegin_usingCDict(LZ4F_cctx* cctxPtr, /* otherwise, a sufficient buffer is allocated, but we need to * reset it to the correct context type */ if (cctxPtr->prefs.compressionLevel < LZ4HC_CLEVEL_MIN) { - LZ4_resetStream((LZ4_stream_t *) cctxPtr->lz4CtxPtr); + LZ4_initStream((LZ4_stream_t *) cctxPtr->lz4CtxPtr, sizeof (LZ4_stream_t)); } else { LZ4_initStreamHC((LZ4_streamHC_t *) cctxPtr->lz4CtxPtr, cctxPtr->prefs.compressionLevel); } |