test(compress): cover Rust local dictionary assignment

The local-dictionary callback is now a C adapter around Rust-owned assignment
policy. Add a small allocator probe and focused tests for by-reference loading,
by-copy data publication, static-CCtx rejection, and allocation failure. The
probe observes the output slots during allocation so the test also protects
the original allocation-before-publication ordering. Strengthen the C and Rust
repr(C) checks with an explicit custom-allocator function-pointer size check.

The capped C-integrated build and original test suite remain deferred to the
main worker, which must run them serially under the repository's 40 GiB virtual
memory limit.

Test Plan:
- `git diff --cached --check` -- passed.
- `rustfmt --check rust/src/zstd_compress_dictionary.rs` -- passed.
- Capped cargo, make, native, fuzzer, and full-suite verification -- not run
  by design; deferred to the main worker.
This commit is contained in:
2026-07-21 21:09:55 +02:00
parent 846e18f6d9
commit 865943e072
2 changed files with 264 additions and 6 deletions
+1
View File
@@ -2914,6 +2914,7 @@ typedef char ZSTD_rust_assign_local_dict_state_layout[
&& offsetof(ZSTD_rust_assignLocalDictState, dictBuffer) == 3 * sizeof(void*)
&& offsetof(ZSTD_rust_assignLocalDictState, dictSize) == 4 * sizeof(void*)
&& offsetof(ZSTD_rust_assignLocalDictState, dictContentType) == 5 * sizeof(void*)
&& sizeof(ZSTD_rust_assignLocalDictAllocate_f) == sizeof(void*)
&& offsetof(ZSTD_rust_assignLocalDictState, allocate) == 6 * sizeof(void*)
&& sizeof(ZSTD_rust_assignLocalDictState) == 7 * sizeof(void*)) ? 1 : -1];
size_t ZSTD_rust_assignLocalDict(