From c8603f2b3ef766e7b0fbabe24b6819a3c3f4b65f Mon Sep 17 00:00:00 2001 From: ddidderr Date: Mon, 20 Jul 2026 11:17:09 +0200 Subject: [PATCH] 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. --- lib/compress/zstdmt_compress.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index 1a280b001..29acfdb6a 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -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 { ZSTDMT_CCtx* mtctx; 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*)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) @@ -2297,7 +2291,7 @@ static void* ZSTDMT_rust_resizeSeqPool(void* opaque, unsigned nbWorkers) static size_t ZSTDMT_rust_resizeSetNbWorkers(void* opaque, unsigned nbWorkers) { 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; }