mirror of
https://github.com/facebook/zstd.git
synced 2025-12-12 00:05:03 -05:00
[visual] Fix unreachable code warning
This commit is contained in:
parent
82d5a9870e
commit
a17fe4c9e5
@ -22,6 +22,7 @@
|
|||||||
/* ====== Dependencies ====== */
|
/* ====== Dependencies ====== */
|
||||||
#include <string.h> /* memcpy, memset */
|
#include <string.h> /* memcpy, memset */
|
||||||
#include <limits.h> /* INT_MAX, UINT_MAX */
|
#include <limits.h> /* INT_MAX, UINT_MAX */
|
||||||
|
#include "mem.h" /* MEM_STATIC */
|
||||||
#include "pool.h" /* threadpool */
|
#include "pool.h" /* threadpool */
|
||||||
#include "threading.h" /* mutex */
|
#include "threading.h" /* mutex */
|
||||||
#include "zstd_compress_internal.h" /* MIN, ERROR, ZSTD_*, ZSTD_highbit32 */
|
#include "zstd_compress_internal.h" /* MIN, ERROR, ZSTD_*, ZSTD_highbit32 */
|
||||||
@ -867,17 +868,13 @@ size_t ZSTDMT_CCtxParam_setNbWorkers(ZSTD_CCtx_params* params, unsigned nbWorker
|
|||||||
return ZSTD_CCtxParams_setParameter(params, ZSTD_c_nbWorkers, (int)nbWorkers);
|
return ZSTD_CCtxParams_setParameter(params, ZSTD_c_nbWorkers, (int)nbWorkers);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced(unsigned nbWorkers, ZSTD_customMem cMem)
|
MEM_STATIC ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced_internal(unsigned nbWorkers, ZSTD_customMem cMem)
|
||||||
{
|
{
|
||||||
ZSTDMT_CCtx* mtctx;
|
ZSTDMT_CCtx* mtctx;
|
||||||
U32 nbJobs = nbWorkers + 2;
|
U32 nbJobs = nbWorkers + 2;
|
||||||
int initError;
|
int initError;
|
||||||
DEBUGLOG(3, "ZSTDMT_createCCtx_advanced (nbWorkers = %u)", nbWorkers);
|
DEBUGLOG(3, "ZSTDMT_createCCtx_advanced (nbWorkers = %u)", nbWorkers);
|
||||||
|
|
||||||
#ifndef ZSTD_MULTITHREAD
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (nbWorkers < 1) return NULL;
|
if (nbWorkers < 1) return NULL;
|
||||||
nbWorkers = MIN(nbWorkers , ZSTDMT_NBWORKERS_MAX);
|
nbWorkers = MIN(nbWorkers , ZSTDMT_NBWORKERS_MAX);
|
||||||
if ((cMem.customAlloc!=NULL) ^ (cMem.customFree!=NULL))
|
if ((cMem.customAlloc!=NULL) ^ (cMem.customFree!=NULL))
|
||||||
@ -906,6 +903,17 @@ ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced(unsigned nbWorkers, ZSTD_customMem cMem)
|
|||||||
return mtctx;
|
return mtctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced(unsigned nbWorkers, ZSTD_customMem cMem)
|
||||||
|
{
|
||||||
|
#ifdef ZSTD_MULTITHREAD
|
||||||
|
return ZSTDMT_createCCtx_advanced_internal(nbWorkers, cMem);
|
||||||
|
#else
|
||||||
|
(void)nbWorkers;
|
||||||
|
(void)cMem;
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
ZSTDMT_CCtx* ZSTDMT_createCCtx(unsigned nbWorkers)
|
ZSTDMT_CCtx* ZSTDMT_createCCtx(unsigned nbWorkers)
|
||||||
{
|
{
|
||||||
return ZSTDMT_createCCtx_advanced(nbWorkers, ZSTD_defaultCMem);
|
return ZSTDMT_createCCtx_advanced(nbWorkers, ZSTD_defaultCMem);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user