feat(compress): route CDict end through Rust
Share the existing end-state projection between the public C wrapper and Rust-owned compressed-dictionary orchestration. The CDict callback now reaches ZSTD_rust_compressEnd through the private dispatcher without re-entering the public C end wrapper, while the exported API keeps its compatibility wrapper. Test Plan: - ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo fmt --manifest-path rust/Cargo.toml --all -- --check - ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo test --manifest-path rust/Cargo.toml --lib - ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings - ulimit -v 41943040; make -j1 - ulimit -v 41943040; make -j1 -C tests test-zstream ZSTREAM_TESTTIME=-T2s - ulimit -v 41943040; make -j1 -C tests test-fuzzer FUZZERTEST=-T3s FUZZER_FLAGS=--no-big-tests
This commit is contained in:
@@ -6205,7 +6205,7 @@ static void ZSTD_rust_compressEnd_trace(void* context, size_t extraCSize)
|
|||||||
ZSTD_CCtx_trace((ZSTD_CCtx*)context, extraCSize);
|
ZSTD_CCtx_trace((ZSTD_CCtx*)context, extraCSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ZSTD_compressEnd_public(ZSTD_CCtx* cctx,
|
static size_t ZSTD_compressEnd_dispatch(ZSTD_CCtx* cctx,
|
||||||
void* dst, size_t dstCapacity,
|
void* dst, size_t dstCapacity,
|
||||||
const void* src, size_t srcSize)
|
const void* src, size_t srcSize)
|
||||||
{
|
{
|
||||||
@@ -6229,6 +6229,13 @@ size_t ZSTD_compressEnd_public(ZSTD_CCtx* cctx,
|
|||||||
&state, dst, dstCapacity, src, srcSize);
|
&state, dst, dstCapacity, src, srcSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t ZSTD_compressEnd_public(ZSTD_CCtx* cctx,
|
||||||
|
void* dst, size_t dstCapacity,
|
||||||
|
const void* src, size_t srcSize)
|
||||||
|
{
|
||||||
|
return ZSTD_compressEnd_dispatch(cctx, dst, dstCapacity, src, srcSize);
|
||||||
|
}
|
||||||
|
|
||||||
/* NOTE: Must just wrap ZSTD_compressEnd_public() */
|
/* NOTE: Must just wrap ZSTD_compressEnd_public() */
|
||||||
size_t ZSTD_compressEnd(ZSTD_CCtx* cctx,
|
size_t ZSTD_compressEnd(ZSTD_CCtx* cctx,
|
||||||
void* dst, size_t dstCapacity,
|
void* dst, size_t dstCapacity,
|
||||||
@@ -6939,7 +6946,7 @@ static size_t ZSTD_rust_compressUsingCDict_end(
|
|||||||
void* context, void* dst, size_t dstCapacity,
|
void* context, void* dst, size_t dstCapacity,
|
||||||
const void* src, size_t srcSize)
|
const void* src, size_t srcSize)
|
||||||
{
|
{
|
||||||
return ZSTD_compressEnd_public(
|
return ZSTD_compressEnd_dispatch(
|
||||||
(ZSTD_CCtx*)context, dst, dstCapacity, src, srcSize);
|
(ZSTD_CCtx*)context, dst, dstCapacity, src, srcSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user