]> git.ipfire.org Git - thirdparty/zstd.git/commit
[libzstd] Require ZSTD_MULTITHREAD to create a ZSTDMT_CCtx
authorNick Terrell <terrelln@fb.com>
Tue, 16 Apr 2019 05:49:44 +0000 (22:49 -0700)
committerNick Terrell <terrelln@fb.com>
Tue, 16 Apr 2019 06:04:46 +0000 (23:04 -0700)
commitde0499f7fa315f36725c93b4d97bd2ceaf6a0dbb
treedb343852bbd080694db56cc33650e4d25a195cad
parenta821aee3b173d597fb987b7ff578c30c3152de85
[libzstd] Require ZSTD_MULTITHREAD to create a ZSTDMT_CCtx

ZSTDMT was broken when compiled without ZSTD_MULTITHREAD defined,
because `ZSTD_CCtx_setParameter(cctx, ZSTD_c_nbWorkers, nbWorkerss)`
failed. It was detected by the MSVC test which runs the fuzzer with
multithreading disabled.

This is a very niche use case of a deprecated API, because the API is
inefficient and synchronous, since `threading.h` will be synchronous.
Users almost certainly don't want this, and anyone who tested their code
should realize that it is broken. Therefore, I think it is safe to
require `ZSTD_MULTITHREAD` to be defined to use ZSTDMT.
CHANGELOG
lib/compress/zstdmt_compress.c
lib/compress/zstdmt_compress.h