refactor(compress): expose LDM skip leaves from Rust
Keep the existing internal ZSTD_ldm_* ABI names while making the two sequence-store skip operations direct Rust exports. Remove only the C forwarding declarations and bodies; LDM state projection, configuration constants, and block-compressor adapters remain in C. Test Plan: - clang -fsyntax-only on lib/compress/zstd_ldm.c - git diff --check - Full capped native/upstream suite pending after this commit
This commit is contained in:
@@ -265,8 +265,6 @@ size_t ZSTD_rust_ldm_generateSequences(
|
|||||||
void* hashTable, BYTE* bucketOffsets, void* window, U32* loadedDictEnd,
|
void* hashTable, BYTE* bucketOffsets, void* window, U32* loadedDictEnd,
|
||||||
void* rawSeqStore, const void* params,
|
void* rawSeqStore, const void* params,
|
||||||
const void* src, size_t srcSize, int overflowCorrectFrequently);
|
const void* src, size_t srcSize, int overflowCorrectFrequently);
|
||||||
void ZSTD_rust_ldm_skipSequences(void* rawSeqStore, size_t srcSize, U32 minMatch);
|
|
||||||
void ZSTD_rust_ldm_skipRawSeqStoreBytes(void* rawSeqStore, size_t nbBytes);
|
|
||||||
size_t ZSTD_rust_ldm_blockCompress(
|
size_t ZSTD_rust_ldm_blockCompress(
|
||||||
void* rawSeqStore, void* blockContext, void* seqStore, U32 rep[ZSTD_REP_NUM],
|
void* rawSeqStore, void* blockContext, void* seqStore, U32 rep[ZSTD_REP_NUM],
|
||||||
const void* src, size_t srcSize, U32 minMatch, int strategy);
|
const void* src, size_t srcSize, U32 minMatch, int strategy);
|
||||||
@@ -387,17 +385,6 @@ size_t ZSTD_ldm_generateSequences(
|
|||||||
ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY);
|
ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZSTD_ldm_skipSequences(RawSeqStore_t* rawSeqStore, size_t srcSize,
|
|
||||||
U32 const minMatch)
|
|
||||||
{
|
|
||||||
ZSTD_rust_ldm_skipSequences(rawSeqStore, srcSize, minMatch);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZSTD_ldm_skipRawSeqStoreBytes(RawSeqStore_t* rawSeqStore, size_t nbBytes)
|
|
||||||
{
|
|
||||||
ZSTD_rust_ldm_skipRawSeqStoreBytes(rawSeqStore, nbBytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t ZSTD_ldm_blockCompress(RawSeqStore_t* rawSeqStore,
|
size_t ZSTD_ldm_blockCompress(RawSeqStore_t* rawSeqStore,
|
||||||
ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
|
||||||
ZSTD_ParamSwitch_e useRowMatchFinder,
|
ZSTD_ParamSwitch_e useRowMatchFinder,
|
||||||
|
|||||||
@@ -903,7 +903,7 @@ unsafe fn skip_sequences(raw_seq_store: *mut RawSeqStore, mut src_size: usize, m
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn ZSTD_rust_ldm_skipSequences(
|
pub unsafe extern "C" fn ZSTD_ldm_skipSequences(
|
||||||
raw_seq_store: *mut c_void,
|
raw_seq_store: *mut c_void,
|
||||||
src_size: usize,
|
src_size: usize,
|
||||||
min_match: u32,
|
min_match: u32,
|
||||||
@@ -912,7 +912,7 @@ pub unsafe extern "C" fn ZSTD_rust_ldm_skipSequences(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn ZSTD_rust_ldm_skipRawSeqStoreBytes(
|
pub unsafe extern "C" fn ZSTD_ldm_skipRawSeqStoreBytes(
|
||||||
raw_seq_store: *mut c_void,
|
raw_seq_store: *mut c_void,
|
||||||
nb_bytes: usize,
|
nb_bytes: usize,
|
||||||
) {
|
) {
|
||||||
@@ -978,7 +978,7 @@ pub unsafe extern "C" fn ZSTD_rust_ldm_blockCompress(
|
|||||||
let last_literals = unsafe {
|
let last_literals = unsafe {
|
||||||
ZSTD_ldm_rust_compressLiterals(block_context, seq_store, reps, src, src_size)
|
ZSTD_ldm_rust_compressLiterals(block_context, seq_store, reps, src, src_size)
|
||||||
};
|
};
|
||||||
unsafe { ZSTD_rust_ldm_skipRawSeqStoreBytes(raw_seq_store.cast::<c_void>(), src_size) };
|
unsafe { ZSTD_ldm_skipRawSeqStoreBytes(raw_seq_store.cast::<c_void>(), src_size) };
|
||||||
return last_literals;
|
return last_literals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user