improved efficiency for large messages with small dictionaries
This commit is contained in:
parent
ea2ecdc315
commit
227cc39e15
2
NEWS
2
NEWS
@ -1,6 +1,6 @@
|
|||||||
v0.7.4
|
v0.7.4
|
||||||
Added : new examples
|
Added : new examples
|
||||||
Fixed : segfault when using small dictionaries
|
Fixed : segfault when using small dictionaries, reported by Felix Handte
|
||||||
Modified : default compression level for CLI is 3
|
Modified : default compression level for CLI is 3
|
||||||
|
|
||||||
|
|
||||||
|
@ -2695,7 +2695,7 @@ static size_t ZSTD_compressBegin_internal(ZSTD_CCtx* zc,
|
|||||||
const void* dict, size_t dictSize,
|
const void* dict, size_t dictSize,
|
||||||
ZSTD_parameters params, U64 pledgedSrcSize)
|
ZSTD_parameters params, U64 pledgedSrcSize)
|
||||||
{
|
{
|
||||||
size_t const resetError = ZSTD_resetCCtx_advanced(zc, params, pledgedSrcSize, 1, 0);
|
size_t const resetError = ZSTD_resetCCtx_advanced(zc, params, pledgedSrcSize, 1, (pledgedSrcSize==0) );
|
||||||
if (ZSTD_isError(resetError)) return resetError;
|
if (ZSTD_isError(resetError)) return resetError;
|
||||||
|
|
||||||
return ZSTD_compress_insertDictionary(zc, dict, dictSize);
|
return ZSTD_compress_insertDictionary(zc, dict, dictSize);
|
||||||
|
@ -209,7 +209,7 @@ static int basicUnitTests(U32 seed, double compressibility)
|
|||||||
cSize += r);
|
cSize += r);
|
||||||
CHECKPLUS(r, ZSTD_compressEnd(ctxDuplicated, (char*)compressedBuffer+cSize, ZSTD_compressBound(CNBuffSize)-cSize),
|
CHECKPLUS(r, ZSTD_compressEnd(ctxDuplicated, (char*)compressedBuffer+cSize, ZSTD_compressBound(CNBuffSize)-cSize),
|
||||||
cSize += r);
|
cSize += r);
|
||||||
if (cSize != cSizeOrig) goto _output_error; /* should be identical ==> have same size */
|
if (cSize != cSizeOrig) goto _output_error; /* should be identical ==> same size */
|
||||||
}
|
}
|
||||||
DISPLAYLEVEL(4, "OK (%u bytes : %.2f%%)\n", (U32)cSize, (double)cSize/CNBuffSize*100);
|
DISPLAYLEVEL(4, "OK (%u bytes : %.2f%%)\n", (U32)cSize, (double)cSize/CNBuffSize*100);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user