diff options
author | Alexander Mohr <alexander.m.mohr@mercedes-benz.com> | 2022-06-10 06:00:38 (GMT) |
---|---|---|
committer | Alexander Mohr <alexander.m.mohr@mercedes-benz.com> | 2022-06-10 06:00:38 (GMT) |
commit | 62f6cef564a9478b92e6dbd0faa81eaa1a90b34f (patch) | |
tree | 1c801d4a4c20dd950abecd0f173013bbb0f48af4 /lib/lz4hc.c | |
parent | 4aeb5020c35e2464c25eb69d8bf6c7645b8faf20 (diff) | |
download | lz4-62f6cef564a9478b92e6dbd0faa81eaa1a90b34f.zip lz4-62f6cef564a9478b92e6dbd0faa81eaa1a90b34f.tar.gz lz4-62f6cef564a9478b92e6dbd0faa81eaa1a90b34f.tar.bz2 |
review: Fix review findings
This commit fixes the review findings
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
Diffstat (limited to 'lib/lz4hc.c')
-rw-r--r-- | lib/lz4hc.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c index da806ef..bf6294d 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -1154,7 +1154,17 @@ int LZ4_compress_HC_continue_destSize (LZ4_streamHC_t* LZ4_streamHCPtr, const ch return LZ4_compressHC_continue_generic(LZ4_streamHCPtr, src, dst, srcSizePtr, targetDestSize, fillOutput); } -int LZ4_DictHCSize(LZ4_streamHC_t* LZ4_streamHCPtr, int dictSize) { +/*! LZ4_getDictHCSize(): + * Get the size of the dictionary. This can be used for adding data without + * compression to the LZ4 archive. If linked blocked mode is used the memory + * of the dictionary is kept free. + * This way uncompressed data does not influence the effectiveness of the + * dictionary. + * @param LZ4_dict Pointer to the dictionary to get the size of. + * @param dictSize The maximum dictionary size. (Normally 64 KB). + * @return The size of the dictionary. + */ +int LZ4_getDictHCSize(LZ4_streamHC_t* LZ4_streamHCPtr, int dictSize) { LZ4HC_CCtx_internal* const streamPtr = &LZ4_streamHCPtr->internal_donotuse; int const prefixSize = (int)(streamPtr->end - (streamPtr->base + streamPtr->dictLimit)); DEBUGLOG(5, "LZ4_saveDictHC(%p, %p, %d)", LZ4_streamHCPtr, safeBuffer, dictSize); @@ -1174,7 +1184,7 @@ int LZ4_DictHCSize(LZ4_streamHC_t* LZ4_streamHCPtr, int dictSize) { int LZ4_saveDictHC (LZ4_streamHC_t* LZ4_streamHCPtr, char* safeBuffer, int dictSize) { LZ4HC_CCtx_internal* const streamPtr = &LZ4_streamHCPtr->internal_donotuse; - dictSize = LZ4_DictHCSize(LZ4_streamHCPtr, dictSize); + dictSize = LZ4_getDictHCSize(LZ4_streamHCPtr, dictSize); if (safeBuffer == NULL) assert(dictSize == 0); if (dictSize > 0) memmove(safeBuffer, streamPtr->end - dictSize, dictSize); |