summaryrefslogtreecommitdiffstats
path: root/lib/lz4.h
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2019-04-05 22:35:19 (GMT)
committerYann Collet <cyan@fb.com>2019-04-05 22:35:19 (GMT)
commit34f0004a5ed5ca5a113432bf2e433966d545133e (patch)
tree8e32e6fcbd89aea6243e655110b3d1693deb30bf /lib/lz4.h
parent2ece0d83809849e68e9c194ff3d340982b527256 (diff)
downloadlz4-34f0004a5ed5ca5a113432bf2e433966d545133e.zip
lz4-34f0004a5ed5ca5a113432bf2e433966d545133e.tar.gz
lz4-34f0004a5ed5ca5a113432bf2e433966d545133e.tar.bz2
added comment on initStream + _extState_
as suggested by @felixhandte
Diffstat (limited to 'lib/lz4.h')
-rw-r--r--lib/lz4.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/lz4.h b/lib/lz4.h
index 3fc67bb..5aa4229 100644
--- a/lib/lz4.h
+++ b/lib/lz4.h
@@ -242,19 +242,23 @@ LZ4LIB_API int LZ4_freeStream (LZ4_stream_t* streamPtr);
* Use this to prepare an LZ4_stream_t for a new chain of dependent blocks
* (e.g., LZ4_compress_fast_continue()).
*
- * An LZ4_stream_t must be initialized once.
+ * An LZ4_stream_t must be initialized once before usage.
* This is automatically done when created by LZ4_createStream().
* However, should the LZ4_stream_t be simply declared on stack (for example),
- * it's necessary to initialize first using LZ4_initStream().
+ * it's necessary to initialize it first, using LZ4_initStream().
*
- * After that, start any new stream with LZ4_resetStream_fast().
+ * After init, start any new stream with LZ4_resetStream_fast().
* A same LZ4_stream_t can be re-used multiple times consecutively
* and compress multiple streams,
* provided that it starts each new stream with LZ4_resetStream_fast().
*
* LZ4_resetStream_fast() is much faster than LZ4_initStream(),
* but is not compatible with memory regions containing garbage data.
- * For this reason, LZ4_stream_t must be initialized at least once,
+ *
+ * Note: it's only useful to call LZ4_resetStream_fast()
+ * in the context of streaming compression.
+ * The *extState* functions perform their own resets.
+ * Invoking LZ4_resetStream_fast() before is redundant, and even counterproductive.
*/
LZ4LIB_API void LZ4_resetStream_fast (LZ4_stream_t* streamPtr);