refactor(compress): remove redundant MT worker setter
Call the existing Rust-backed public parameter setter directly from the MT create and resize callbacks. Remove the C-only helper that added no policy or resource ownership beyond that forwarding call. Test Plan: Worker ran `clang -fsyntax-only`, `git diff --check`, and a symbol-reference audit; capped native and upstream gates pending.
This commit is contained in:
@@ -1967,13 +1967,6 @@ static size_t ZSTDMT_expandJobsTable (ZSTDMT_CCtx* mtctx, U32 nbWorkers) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ZSTDMT_CCtxParam_setNbWorkers():
|
|
||||||
* Internal use only */
|
|
||||||
static size_t ZSTDMT_CCtxParam_setNbWorkers(ZSTD_CCtx_params* params, unsigned nbWorkers)
|
|
||||||
{
|
|
||||||
return ZSTD_CCtxParams_setParameter(params, ZSTD_c_nbWorkers, (int)nbWorkers);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ZSTDMT_CCtx* mtctx;
|
ZSTDMT_CCtx* mtctx;
|
||||||
ZSTD_customMem cMem;
|
ZSTD_customMem cMem;
|
||||||
@@ -1992,7 +1985,8 @@ static size_t ZSTDMT_rust_createCCtx_setWorkers(void* opaque, unsigned nbWorkers
|
|||||||
{
|
{
|
||||||
ZSTDMT_rust_createCCtx_context* const context =
|
ZSTDMT_rust_createCCtx_context* const context =
|
||||||
(ZSTDMT_rust_createCCtx_context*)opaque;
|
(ZSTDMT_rust_createCCtx_context*)opaque;
|
||||||
return ZSTDMT_CCtxParam_setNbWorkers(&context->mtctx->params, nbWorkers);
|
return ZSTD_CCtxParams_setParameter(
|
||||||
|
&context->mtctx->params, ZSTD_c_nbWorkers, (int)nbWorkers);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ZSTDMT_rust_createCCtx_setInitialState(void* opaque)
|
static void ZSTDMT_rust_createCCtx_setInitialState(void* opaque)
|
||||||
@@ -2297,7 +2291,7 @@ static void* ZSTDMT_rust_resizeSeqPool(void* opaque, unsigned nbWorkers)
|
|||||||
static size_t ZSTDMT_rust_resizeSetNbWorkers(void* opaque, unsigned nbWorkers)
|
static size_t ZSTDMT_rust_resizeSetNbWorkers(void* opaque, unsigned nbWorkers)
|
||||||
{
|
{
|
||||||
ZSTDMT_CCtx* const mtctx = (ZSTDMT_CCtx*)opaque;
|
ZSTDMT_CCtx* const mtctx = (ZSTDMT_CCtx*)opaque;
|
||||||
(void)ZSTDMT_CCtxParam_setNbWorkers(&mtctx->params, nbWorkers);
|
(void)ZSTD_CCtxParams_setParameter(&mtctx->params, ZSTD_c_nbWorkers, (int)nbWorkers);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user