]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
disabled MT code path when ZSTD_MULTITHREAD is not defined
authorYann Collet <cyan@fb.com>
Mon, 12 Jun 2017 01:46:09 +0000 (18:46 -0700)
committerYann Collet <cyan@fb.com>
Mon, 12 Jun 2017 01:46:09 +0000 (18:46 -0700)
lib/compress/zstd_compress.c

index 338dd7472934ca745ccd62a3177ca673090afda9..db672da0451d66cfb34cd9ffb2c7fe31d6e5ea15 100644 (file)
@@ -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) );