From: Yann Collet Date: Mon, 25 Jun 2018 19:42:31 +0000 (-0700) Subject: Merge pull request #1200 from felixhandte/zstd-attach-dict-pref X-Git-Tag: v1.3.5~3^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b53bfe4f3f0a9bcc4f9be014b83896a370ba5ff;p=thirdparty%2Fzstd.git Merge pull request #1200 from felixhandte/zstd-attach-dict-pref Add CCtx Param Controlling Dict Attachment Behavior --- 3b53bfe4f3f0a9bcc4f9be014b83896a370ba5ff diff --cc lib/compress/zstd_compress.c index 0e05e488f,d7bcffdf2..96ffe244a --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@@ -1239,13 -1251,16 +1252,15 @@@ static size_t ZSTD_resetCCtx_usingCDict 32 KB, /* ZSTD_lazy */ 32 KB, /* ZSTD_lazy2 */ 32 KB, /* ZSTD_btlazy2 */ - 256 KB, /* ZSTD_btopt */ - 256 KB /* ZSTD_btultra */ + 32 KB, /* ZSTD_btopt */ + 8 KB /* ZSTD_btultra */ }; const int attachDict = ( pledgedSrcSize <= attachDictSizeCutoffs[cdict->cParams.strategy] - || pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN ) + || pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN + || params.attachDictPref == ZSTD_dictForceAttach ) + && params.attachDictPref != ZSTD_dictForceCopy && !params.forceWindow /* dictMatchState isn't correctly * handled in _enforceMaxDist */ - && cdict->cParams.strategy <= ZSTD_btlazy2 && ZSTD_equivalentCParams(cctx->appliedParams.cParams, cdict->cParams);