From: Yann Collet Date: Fri, 16 Jun 2017 19:04:21 +0000 (-0700) Subject: fixed : new advanced AIP : setting nbThreads to the same value > 1 X-Git-Tag: v1.3.0~1^2~17^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33873f0e743376b0554b1e58526e37d2d63c09b6;p=thirdparty%2Fzstd.git fixed : new advanced AIP : setting nbThreads to the same value > 1 --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index dfaa1854f..a482a7f7f 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -335,6 +335,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned v case ZSTD_p_nbThreads: if (value==0) return 0; + DEBUGLOG(5, " setting nbThreads : %u", value); #ifndef ZSTD_MULTITHREAD if (value > 1) return ERROR(compressionParameter_unsupported); #endif @@ -345,9 +346,8 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned v cctx->nbThreads = 1; cctx->mtctx = ZSTDMT_createCCtx(value); if (cctx->mtctx == NULL) return ERROR(memory_allocation); - cctx->nbThreads = value; - } else - cctx->nbThreads = 1; + } + cctx->nbThreads = value; return 0; case ZSTD_p_jobSize: @@ -356,6 +356,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned v return ZSTDMT_setMTCtxParameter(cctx->mtctx, ZSTDMT_p_sectionSize, value); case ZSTD_p_overlapSizeLog: + DEBUGLOG(5, " setting overlap with nbThreads == %u", cctx->nbThreads); if (cctx->nbThreads <= 1) return ERROR(compressionParameter_unsupported); assert(cctx->mtctx != NULL); return ZSTDMT_setMTCtxParameter(cctx->mtctx, ZSTDMT_p_overlapSectionLog, value);