Add compatibility for multithreading
This commit is contained in:
@@ -1542,7 +1542,7 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc,
|
|||||||
|
|
||||||
zc->isFirstBlock = 1;
|
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 */
|
/* Enable LDM by default for optimal parser and window size >= 128MB */
|
||||||
DEBUGLOG(4, "LDM enabled by default (window size >= 128MB, strategy >= btopt)");
|
DEBUGLOG(4, "LDM enabled by default (window size >= 128MB, strategy >= btopt)");
|
||||||
params.ldmParams.enableLdm = 1;
|
params.ldmParams.enableLdm = 1;
|
||||||
|
|||||||
@@ -1459,6 +1459,13 @@ size_t ZSTDMT_initCStream_internal(
|
|||||||
|
|
||||||
mtctx->params = params;
|
mtctx->params = params;
|
||||||
mtctx->frameContentSize = pledgedSrcSize;
|
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) {
|
if (dict) {
|
||||||
ZSTD_freeCDict(mtctx->cdictLocal);
|
ZSTD_freeCDict(mtctx->cdictLocal);
|
||||||
mtctx->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize,
|
mtctx->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize,
|
||||||
|
|||||||
Reference in New Issue
Block a user