summaryrefslogtreecommitdiffstats
path: root/doc/lz4_manual.html
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2018-10-15 18:14:30 (GMT)
committerYann Collet <cyan@fb.com>2018-10-15 18:14:30 (GMT)
commitbf9bf80f8d06aab75347ed6df62758511e91fbe3 (patch)
treedaf22cb208ea2eb0686a94ce4ca959162ffc7af3 /doc/lz4_manual.html
parent5bd197e838269003e8d217cc0c83c03567e3cec7 (diff)
downloadlz4-bf9bf80f8d06aab75347ed6df62758511e91fbe3.zip
lz4-bf9bf80f8d06aab75347ed6df62758511e91fbe3.tar.gz
lz4-bf9bf80f8d06aab75347ed6df62758511e91fbe3.tar.bz2
updated code documentation
to clarify #589
Diffstat (limited to 'doc/lz4_manual.html')
-rw-r--r--doc/lz4_manual.html25
1 files changed, 15 insertions, 10 deletions
diff --git a/doc/lz4_manual.html b/doc/lz4_manual.html
index 5e04263..4c4734a 100644
--- a/doc/lz4_manual.html
+++ b/doc/lz4_manual.html
@@ -304,19 +304,22 @@ int LZ4_decompress_fast_usingDict (const char* src, char* dst, int originalSize,
<BR></pre>
<pre><b>LZ4LIB_STATIC_API void LZ4_resetStream_fast (LZ4_stream_t* streamPtr);
-</b><p> Use this, like LZ4_resetStream(), to prepare a context for a new chain of
- calls to a streaming API (e.g., LZ4_compress_fast_continue()).
+</b><p> Use this to prepare a context for a new chain of calls to a streaming API
+ (e.g., LZ4_compress_fast_continue()).
+
+ Note:
+ To stay on the safe side, when LZ4_stream_t is used for the first time,
+ it should be either created using LZ4_createStream() or
+ initialized using LZ4_resetStream().
Note:
Using this in advance of a non-streaming-compression function is redundant,
since they all perform their own custom reset internally.
Differences from LZ4_resetStream():
- When an LZ4_stream_t is known to be in a internally coherent state,
- it can often be prepared for a new compression with almost no work,
- only sometimes falling back to the full, expensive reset
- that is always required when the stream is in an indeterminate state
- (i.e., the reset performed by LZ4_resetStream()).
+ When an LZ4_stream_t is known to be in an internally coherent state,
+ it will be prepared for a new compression with almost no work.
+ Otherwise, it will fall back to the full, expensive reset.
LZ4_streams are guaranteed to be in a valid state when:
- returned from LZ4_createStream()
@@ -329,9 +332,11 @@ int LZ4_decompress_fast_usingDict (const char* src, char* dst, int originalSize,
call that fully reset the state (e.g., LZ4_compress_fast_extState()) and
that returned success
- When a stream isn't known to be in a valid state, it is not safe to pass to
- any fastReset or streaming function. It must first be cleansed by the full
- LZ4_resetStream().
+ Note:
+ A stream that was used in a compression call that did not return success
+ (e.g., LZ4_compress_fast_continue()), can still be passed to this function,
+ however, it's history is not preserved because of previous compression
+ failure.
</p></pre><BR>