added protection : MT incompatible with Static allocation
This commit is contained in:
1 parent
bb0aaf9579
commit
05ae4b2190
2 files changed
+4
-1
No files matched your search
@@ -339,6 +339,8 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned v
|
||||
if (value > 1) return ERROR(compressionParameter_unsupported);
|
||||
#endif
|
||||
if ((value>1) && (cctx->nbThreads != value)) {
|
||||
if (cctx->staticSize) /* MT not compatible with static alloc */
|
||||
return ERROR(compressionParameter_unsupported);
|
||||
ZSTDMT_freeCCtx(cctx->mtctx);
|
||||
cctx->nbThreads = value;
|
||||
cctx->mtctx = ZSTDMT_createCCtx(value);
|
||||
|
||||
Reference in new issue
Block a user