From: Yann Collet Date: Mon, 12 Jun 2017 01:46:09 +0000 (-0700) Subject: disabled MT code path when ZSTD_MULTITHREAD is not defined X-Git-Tag: v1.3.0~1^2~17^2~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f129fd39703183920ecd673bf6a94a2322b92771;p=thirdparty%2Fzstd.git disabled MT code path when ZSTD_MULTITHREAD is not defined --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 338dd7472..db672da04 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -3760,18 +3760,24 @@ size_t ZSTD_compress_generic (ZSTD_CCtx* cctx, if (cctx->compressionLevel != ZSTD_CLEVEL_CUSTOM) params.cParams = ZSTD_getCParams(cctx->compressionLevel, cctx->frameContentSize, 0 /* dictSize */); + +#ifdef ZSTD_MULTITHREAD if (cctx->nbThreads > 1) { CHECK_F( ZSTDMT_initCStream_internal(cctx->mtctx, NULL, 0, cctx->cdict, params, cctx->frameContentSize) ); cctx->streamStage = zcss_load; - } else { + } else +#endif + { CHECK_F( ZSTD_resetCStream_internal(cctx, params, cctx->frameContentSize) ); } } +#ifdef ZSTD_MULTITHREAD if (cctx->nbThreads > 1) { size_t const flushMin = ZSTDMT_compressStream_generic(cctx->mtctx, output, input, endOp); if (ZSTD_isError(flushMin)) cctx->streamStage = zcss_init; return flushMin; } +#endif DEBUGLOG(5, "starting ZSTD_compressStream_generic"); CHECK_F( ZSTD_compressStream_generic(cctx, output, input, endOp) );