refactor(mt): export window overlap policy from Rust

Move the MT LDM overlap predicate behind the original
ZSTDMT_doesOverlapWindow() by-value ABI. Rust now owns the half-open range
calculation through a checked representation of Buffer and ZSTD_window_t;
C retains the synchronization and context orchestration around the callback.

Test Plan:
- `cc -fsyntax-only -Ilib -Ilib/common -Ilib/compress -Ilib/decompress -Ilib/dict -Ilib/legacy lib/compress/zstdmt_compress.c` -- passed.
- `cargo +nightly fmt --manifest-path rust/Cargo.toml --all -- --check` -- passed.
- `git diff --check` and `git diff --cached --check` -- passed.
- Heavy verification intentionally deferred until the combined seam set is ready.
This commit is contained in:
2026-07-20 13:59:15 +02:00
parent fe3587c637
commit 8919e0d292
2 changed files with 69 additions and 15 deletions
+1 -15
View File
@@ -2910,21 +2910,7 @@ static Range ZSTDMT_getInputDataInUse(ZSTDMT_CCtx* mtctx)
return (Range){ range.start, range.size };
}
static int ZSTDMT_doesOverlapWindow(Buffer buffer, ZSTD_window_t window)
{
DEBUGLOG(5, "ZSTDMT_doesOverlapWindow");
DEBUGLOG(5, "extDict [0x%zx, 0x%zx)",
(size_t)window.dictBase + window.lowLimit,
(size_t)window.dictBase + window.dictLimit);
DEBUGLOG(5, "prefix [0x%zx, 0x%zx)",
(size_t)window.base + window.dictLimit,
(size_t)window.nextSrc);
return ZSTDMT_rust_doesOverlapWindow(buffer.start, buffer.capacity,
window.nextSrc, window.base,
window.dictBase, window.dictLimit,
window.lowLimit);
}
int ZSTDMT_doesOverlapWindow(Buffer buffer, ZSTD_window_t window);
static void ZSTDMT_waitForLdmLock(void* opaque)
{