When Attaching Dictionary, Size Working Tables Based on Input Size Only
This commit is contained in:
@@ -1344,8 +1344,9 @@ static size_t ZSTD_resetCCtx_byAttachingCDict(
|
|||||||
const ZSTD_compressionParameters *cdict_cParams = &cdict->matchState.cParams;
|
const ZSTD_compressionParameters *cdict_cParams = &cdict->matchState.cParams;
|
||||||
unsigned const windowLog = params.cParams.windowLog;
|
unsigned const windowLog = params.cParams.windowLog;
|
||||||
assert(windowLog != 0);
|
assert(windowLog != 0);
|
||||||
/* Copy only compression parameters related to tables. */
|
/* Resize working context table params for input only, since the dict
|
||||||
params.cParams = *cdict_cParams;
|
* has its own tables. */
|
||||||
|
params.cParams = ZSTD_adjustCParams_internal(*cdict_cParams, pledgedSrcSize, 0);
|
||||||
params.cParams.windowLog = windowLog;
|
params.cParams.windowLog = windowLog;
|
||||||
ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize,
|
ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize,
|
||||||
ZSTDcrp_continue, zbuff);
|
ZSTDcrp_continue, zbuff);
|
||||||
|
|||||||
Reference in New Issue
Block a user