diff options
author | Yann Collet <cyan@fb.com> | 2018-02-28 07:23:27 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2018-02-28 07:23:27 (GMT) |
commit | b5233d3726b416b1176c71483d20b4c543851c6f (patch) | |
tree | a9d73424fdc8d0e93d29614f8b45dba960e7b949 | |
parent | 85201c4beb6ebbe8fcb60162a6f5c00ed6680d91 (diff) | |
download | lz4-b5233d3726b416b1176c71483d20b4c543851c6f.zip lz4-b5233d3726b416b1176c71483d20b4c543851c6f.tar.gz lz4-b5233d3726b416b1176c71483d20b4c543851c6f.tar.bz2 |
updated LZ4F_compressBound() documentation
to clarify it includes potentially buffered data.
-rw-r--r-- | doc/lz4frame_manual.html | 9 | ||||
-rw-r--r-- | lib/lz4frame.h | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/doc/lz4frame_manual.html b/doc/lz4frame_manual.html index db004ab..f0f7f5a 100644 --- a/doc/lz4frame_manual.html +++ b/doc/lz4frame_manual.html @@ -153,10 +153,13 @@ LZ4F_errorCode_t LZ4F_freeCompressionContext(LZ4F_cctx* cctx); </p></pre><BR> <pre><b>size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t* prefsPtr); -</b><p> Provides minimum dstCapacity for a given srcSize to guarantee operation success in worst case scenarios. - Estimation includes frame footer, which would be generated by LZ4F_compressEnd(). - Estimation doesn't include frame header, already generated by LZ4F_compressBegin(). +</b><p> Provides minimum dstCapacity required to guarantee compression success + given a srcSize and preferences, covering worst case scenario. prefsPtr is optional : when NULL is provided, preferences will be set to cover worst case scenario. + Estimation is valid for either LZ4F_compressUpdate(), LZ4F_flush() or LZ4F_compressEnd(), + Estimation includes the possibility that internal buffer might already be filled by up to (blockSize-1) bytes. + It also includes frame footer (ending + checksum), which would have to be generated by LZ4F_compressEnd(). + Estimation doesn't include frame header, as it was already generated by LZ4F_compressBegin(). Result is always the same for a srcSize and prefsPtr, so it can be trusted to size reusable buffers. When srcSize==0, LZ4F_compressBound() provides an upper bound for LZ4F_flush() and LZ4F_compressEnd() operations. diff --git a/lib/lz4frame.h b/lib/lz4frame.h index 15484d7..9efaca0 100644 --- a/lib/lz4frame.h +++ b/lib/lz4frame.h @@ -250,10 +250,13 @@ LZ4FLIB_API size_t LZ4F_compressBegin(LZ4F_cctx* cctx, const LZ4F_preferences_t* prefsPtr); /*! LZ4F_compressBound() : - * Provides minimum dstCapacity for a given srcSize to guarantee operation success in worst case scenarios. - * Estimation includes frame footer, which would be generated by LZ4F_compressEnd(). - * Estimation doesn't include frame header, already generated by LZ4F_compressBegin(). + * Provides minimum dstCapacity required to guarantee compression success + * given a srcSize and preferences, covering worst case scenario. * prefsPtr is optional : when NULL is provided, preferences will be set to cover worst case scenario. + * Estimation is valid for either LZ4F_compressUpdate(), LZ4F_flush() or LZ4F_compressEnd(), + * Estimation includes the possibility that internal buffer might already be filled by up to (blockSize-1) bytes. + * It also includes frame footer (ending + checksum), which would have to be generated by LZ4F_compressEnd(). + * Estimation doesn't include frame header, as it was already generated by LZ4F_compressBegin(). * Result is always the same for a srcSize and prefsPtr, so it can be trusted to size reusable buffers. * When srcSize==0, LZ4F_compressBound() provides an upper bound for LZ4F_flush() and LZ4F_compressEnd() operations. */ |