feat(compress): move CCtx zstd parameter setter to Rust
Keep the C helper's ZSTD_checkCParams assertion at the call boundary while moving its three field assignments into the existing repr(C) Rust CCtx parameter module. The Rust leaf updates cParams and fParams, resets the compression-level marker to NO_CLEVEL, and leaves unrelated CCtx state intact. Test Plan: - `cargo test --manifest-path rust/Cargo.toml --no-default-features --features compression set_zstd_params_updates_only_zstd_parameter_fields` -- passed - `make -B -C lib -j2 lib` -- passed - `make -C tests -j2 fuzzer` -- passed - `tests/fuzzer -s4560 -t47 -i48 -v` -- passed - required clippy trio, nightly fmt, post-format clippy trio, and `git diff --check` -- passed
This commit is contained in:
@@ -137,6 +137,8 @@ ZSTD_CCtx_params* ZSTD_rust_createCCtxParams(ZSTD_customMem customMem);
|
||||
size_t ZSTD_rust_freeCCtxParams(ZSTD_CCtx_params* params);
|
||||
size_t ZSTD_rust_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams,
|
||||
ZSTD_parameters params);
|
||||
void ZSTD_rust_CCtxParams_setZstdParams(ZSTD_CCtx_params* cctxParams,
|
||||
const ZSTD_parameters* params);
|
||||
int ZSTD_rust_useTargetCBlockSize(const ZSTD_CCtx_params* cctxParams);
|
||||
int ZSTD_rust_blockSplitterEnabled(ZSTD_CCtx_params* cctxParams);
|
||||
|
||||
@@ -711,12 +713,7 @@ static void ZSTD_CCtxParams_setZstdParams(
|
||||
ZSTD_CCtx_params* cctxParams, const ZSTD_parameters* params)
|
||||
{
|
||||
assert(!ZSTD_checkCParams(params->cParams));
|
||||
cctxParams->cParams = params->cParams;
|
||||
cctxParams->fParams = params->fParams;
|
||||
/* Should not matter, as all cParams are presumed properly defined.
|
||||
* But, set it for tracing anyway.
|
||||
*/
|
||||
cctxParams->compressionLevel = ZSTD_NO_CLEVEL;
|
||||
ZSTD_rust_CCtxParams_setZstdParams(cctxParams, params);
|
||||
}
|
||||
|
||||
ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param)
|
||||
|
||||
Reference in New Issue
Block a user