feat(compress): move advanced CCtx parameter init to Rust
Move ZSTD_CCtxParams_init_advanced and its default-resolution policy into the Rust parameter API while retaining the C public ABI wrapper. Preserve validation, zeroing, and the existing row-match, block-splitter, LDM, and repcode defaults. Test Plan:\n- cargo clippy --manifest-path rust/Cargo.toml\n- cargo clippy --manifest-path rust/Cargo.toml --benches\n- cargo clippy --manifest-path rust/Cargo.toml --tests\n- cargo +nightly fmt --manifest-path rust/Cargo.toml --all -- --check\n- cargo test --manifest-path rust/Cargo.toml --no-default-features --features compression zstd_compress_params_api\n- make -B -C lib -j2 lib
This commit is contained in:
@@ -89,6 +89,8 @@ int ZSTD_rust_cctx_params_is_multithreaded(void);
|
||||
int ZSTD_rust_cctx_params_job_size_min(void);
|
||||
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);
|
||||
|
||||
#define ZSTD_RUST_CCTX_PARAMS_ASSERT(name, condition) \
|
||||
typedef char name[(condition) ? 1 : -1]
|
||||
@@ -577,10 +579,7 @@ ZSTD_CCtxParams_init_internal(ZSTD_CCtx_params* cctxParams,
|
||||
|
||||
size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params)
|
||||
{
|
||||
RETURN_ERROR_IF(!cctxParams, GENERIC, "NULL pointer!");
|
||||
FORWARD_IF_ERROR( ZSTD_checkCParams(params.cParams) , "");
|
||||
ZSTD_CCtxParams_init_internal(cctxParams, ¶ms, ZSTD_NO_CLEVEL);
|
||||
return 0;
|
||||
return ZSTD_rust_CCtxParams_init_advanced(cctxParams, params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user