Add ldm enable condition in ZSTD_resetCCtx_internal

This commit is contained in:
senhuang42 2020-10-19 10:26:17 -04:00
parent 8c46c1d851
commit 590f7f55f0

View File

@ -1542,6 +1542,12 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc,
zc->isFirstBlock = 1;
if (params.cParams.strategy >= ZSTD_btopt && params.cParams.windowLog >= 27) {
/* Enable LDM by default for optimal parser and window size >= 128MB */
DEBUGLOG(4, "LDM enabled by default (window size >= 128MB, strategy >= btopt)");
params.ldmParams.enableLdm = 1;
}
if (params.ldmParams.enableLdm) {
/* Adjust long distance matching parameters */
ZSTD_ldm_adjustParameters(&params.ldmParams, &params.cParams);