Add compatibility for multithreading
parent
aad436da37
commit
b1c7fc5768
|
@ -1542,7 +1542,7 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc,
|
|||
|
||||
zc->isFirstBlock = 1;
|
||||
|
||||
if (params.cParams.strategy >= ZSTD_btopt && params.cParams.windowLog >= 27) {
|
||||
if (params.cParams.strategy >= ZSTD_btopt && params.cParams.windowLog >= 27 && params.nbWorkers == 0) {
|
||||
/* 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;
|
||||
|
|
|
@ -1459,6 +1459,13 @@ size_t ZSTDMT_initCStream_internal(
|
|||
|
||||
mtctx->params = params;
|
||||
mtctx->frameContentSize = pledgedSrcSize;
|
||||
|
||||
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 (dict) {
|
||||
ZSTD_freeCDict(mtctx->cdictLocal);
|
||||
mtctx->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize,
|
||||
|
|
Loading…
Reference in New Issue