refactor(compress): expose compressed block reset from Rust

The compressed-block reset logic was already implemented in Rust, but the
Rust export used a private bridge name and C retained a forwarding wrapper
under the original ABI name. Export the original
`ZSTD_reset_compressedBlockState` symbol directly from Rust, keep the
`ZSTD_rust_resetCompressedBlockState` crate-local alias for existing Rust
callers, and remove only the redundant C declaration and body. Private
context-layout code and other C functions remain unchanged.

Test Plan:
- `git diff --check` -- passed.
- `cc -std=c99 -Ilib -Ilib/common -Ilib/compress -Ilib/decompress -Ilib/dict -fsyntax-only lib/compress/zstd_compress.c` -- passed.
- `cargo +nightly fmt --manifest-path rust/Cargo.toml --all -- --check` -- passed.
- Cargo build/test and make were intentionally not run per the requested lightweight-only scope.
This commit is contained in:
2026-07-20 13:00:39 +02:00
parent 6bff89163f
commit ca9e383771
2 changed files with 4 additions and 8 deletions
-6
View File
@@ -2125,7 +2125,6 @@ size_t ZSTD_rust_buildBlockEntropyStats(
int strategy, int disableLiteralCompression,
ZSTD_entropyCTablesMetadata_t* entropyMetadata,
void* workspace, size_t wkspSize);
void ZSTD_rust_resetCompressedBlockState(ZSTD_compressedBlockState_t* bs);
void ZSTD_rust_invalidateRepCodes(U32 rep[ZSTD_REP_NUM]);
void ZSTD_rust_invalidateMatchState(
size_t endT, U32* lowLimit, U32* dictLimit,
@@ -4163,11 +4162,6 @@ size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx)
return ZSTD_rust_toFlushNow(&state);
}
void ZSTD_reset_compressedBlockState(ZSTD_compressedBlockState_t* bs)
{
ZSTD_rust_resetCompressedBlockState(bs);
}
/**
* Controls, for this matchState reset, whether the tables need to be cleared /
* prepared for the coming compression (ZSTDcrp_makeClean), or whether the