diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index a64b4d9bb..b17de4cb0 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -2139,8 +2139,6 @@ void ZSTD_rust_storeLastLiterals(SeqStore_t* seqStorePtr, void ZSTD_rust_validateSeqStore(const SeqStore_t* seqStore, U32 minMatch); U32 ZSTD_rust_resolveRepcodeToRawOffset(const U32 rep[ZSTD_REP_NUM], U32 offBase, U32 ll0); -size_t ZSTD_rust_loadCEntropy(ZSTD_compressedBlockState_t* bs, void* workspace, - const void* dict, size_t dictSize); /* Rust owns dictionary-content orchestration and policy. The callbacks below * keep configuration-sensitive match-state, LDM, workspace, and matchfinder * operations private to C. */ @@ -6231,14 +6229,6 @@ static void ZSTD_loadDictionaryContent_assertInvalidStrategy(void* opaque) } -/* Dictionary entropy-header loading and content orchestration live in Rust; - * this keeps the original internal symbol available to C callers. */ -size_t ZSTD_loadCEntropy(ZSTD_compressedBlockState_t* bs, void* workspace, - const void* const dict, size_t dictSize) -{ - return ZSTD_rust_loadCEntropy(bs, workspace, dict, dictSize); -} - /* Package only scalar policy inputs and opaque private-operation callbacks for * the Rust dictionary-content orchestrator. */ static size_t ZSTD_loadDictionaryContent_callback( diff --git a/rust/src/zstd_compress_dictionary.rs b/rust/src/zstd_compress_dictionary.rs index fec8140cc..a5af0630c 100644 --- a/rust/src/zstd_compress_dictionary.rs +++ b/rust/src/zstd_compress_dictionary.rs @@ -5,8 +5,7 @@ //! Dictionary entropy-header loading. //! //! This is the Rust leaf for `ZSTD_dictNCountRepeat()` and -//! `ZSTD_loadCEntropy()` in `lib/compress/zstd_compress.c`. C retains the -//! original symbols through thin compatibility shims and keeps the +//! `ZSTD_loadCEntropy()` in `lib/compress/zstd_compress.c`. C keeps the //! configuration-sensitive dictionary-content operations on its side. use crate::bits::ZSTD_highbit32; @@ -2256,7 +2255,7 @@ unsafe fn read_and_build_fse_table( /// truncated entropy headers are converted to `ZSTD_error_dictionaryCorrupted` /// just as the C `RETURN_ERROR_IF(..., dictionary_corrupted, ...)` paths do. #[no_mangle] -pub unsafe extern "C" fn ZSTD_rust_loadCEntropy( +pub unsafe extern "C" fn ZSTD_loadCEntropy( bs: *mut ZSTD_compressedBlockState_t, workspace: *mut c_void, dict: *const c_void, @@ -2401,6 +2400,8 @@ pub unsafe extern "C" fn ZSTD_rust_loadCEntropy( offset } +pub(crate) use ZSTD_loadCEntropy as ZSTD_rust_loadCEntropy; + /// Rust-owned dispatch for C's `ZSTD_compress_insertDictionary()`. /// /// The callback is the only operation that still crosses back into C. It