mirror of
https://github.com/facebook/zstd.git
synced 2025-10-08 00:04:02 -04:00
Bump Split Log Support to ZSTD_btlazy2
This commit is contained in:
parent
22fcb8d4c7
commit
e710dc3369
@ -1320,6 +1320,8 @@ static const size_t attachDictSizeCutoffs[(unsigned)ZSTD_btultra+1] = {
|
|||||||
8 KB /* ZSTD_btultra */
|
8 KB /* ZSTD_btultra */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const ZSTD_strategy splitLogCutoffStrategy = ZSTD_btlazy2;
|
||||||
|
|
||||||
static int ZSTD_shouldAttachDict(ZSTD_CCtx* cctx,
|
static int ZSTD_shouldAttachDict(ZSTD_CCtx* cctx,
|
||||||
const ZSTD_CDict* cdict,
|
const ZSTD_CDict* cdict,
|
||||||
ZSTD_CCtx_params params,
|
ZSTD_CCtx_params params,
|
||||||
@ -1332,8 +1334,8 @@ static int ZSTD_shouldAttachDict(ZSTD_CCtx* cctx,
|
|||||||
&& params.attachDictPref != ZSTD_dictForceCopy
|
&& params.attachDictPref != ZSTD_dictForceCopy
|
||||||
&& !params.forceWindow /* dictMatchState isn't correctly
|
&& !params.forceWindow /* dictMatchState isn't correctly
|
||||||
* handled in _enforceMaxDist */
|
* handled in _enforceMaxDist */
|
||||||
&& ( (cdict->matchState.cParams.strategy <= ZSTD_dfast)
|
&& ( (cdict->matchState.cParams.strategy <= splitLogCutoffStrategy)
|
||||||
|| (cdict->matchState.cParams.strategy > ZSTD_dfast &&
|
|| (cdict->matchState.cParams.strategy > splitLogCutoffStrategy &&
|
||||||
ZSTD_equivalentCParams(cctx->appliedParams.cParams,
|
ZSTD_equivalentCParams(cctx->appliedParams.cParams,
|
||||||
cdict->matchState.cParams)));
|
cdict->matchState.cParams)));
|
||||||
}
|
}
|
||||||
@ -1351,7 +1353,7 @@ static size_t ZSTD_resetCCtx_byAttachingCDict(ZSTD_CCtx* cctx,
|
|||||||
/* Copy only compression parameters related to tables. */
|
/* Copy only compression parameters related to tables. */
|
||||||
params.cParams = *cdict_cParams;
|
params.cParams = *cdict_cParams;
|
||||||
params.cParams.windowLog = windowLog;
|
params.cParams.windowLog = windowLog;
|
||||||
if (params.cParams.strategy <= ZSTD_dfast) {
|
if (params.cParams.strategy <= splitLogCutoffStrategy) {
|
||||||
DEBUGLOG(4, "Overriding hashLog from %d to %d", params.cParams.hashLog, cctx->requestedParams.cParams.hashLog);
|
DEBUGLOG(4, "Overriding hashLog from %d to %d", params.cParams.hashLog, cctx->requestedParams.cParams.hashLog);
|
||||||
DEBUGLOG(4, "Overriding chainLog from %d to %d", params.cParams.chainLog, cctx->requestedParams.cParams.chainLog);
|
DEBUGLOG(4, "Overriding chainLog from %d to %d", params.cParams.chainLog, cctx->requestedParams.cParams.chainLog);
|
||||||
if (cctx->requestedParams.cParams.hashLog)
|
if (cctx->requestedParams.cParams.hashLog)
|
||||||
@ -1362,7 +1364,7 @@ static size_t ZSTD_resetCCtx_byAttachingCDict(ZSTD_CCtx* cctx,
|
|||||||
ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize,
|
ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize,
|
||||||
ZSTDcrp_continue, zbuff);
|
ZSTDcrp_continue, zbuff);
|
||||||
assert(cctx->appliedParams.cParams.strategy == cdict_cParams->strategy);
|
assert(cctx->appliedParams.cParams.strategy == cdict_cParams->strategy);
|
||||||
if (params.cParams.strategy > ZSTD_dfast) {
|
if (params.cParams.strategy > splitLogCutoffStrategy) {
|
||||||
assert(cctx->appliedParams.cParams.hashLog == cdict_cParams->hashLog);
|
assert(cctx->appliedParams.cParams.hashLog == cdict_cParams->hashLog);
|
||||||
assert(cctx->appliedParams.cParams.chainLog == cdict_cParams->chainLog);
|
assert(cctx->appliedParams.cParams.chainLog == cdict_cParams->chainLog);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user