mirror of
https://github.com/lz4/lz4.git
synced 2026-10-24 01:48:57 +03:00
Prototype, not intended for a PR as is.
- LZ4F_preferences_t : reserved array replaced by explicit scalar fields
(nbWorkers, reserved1, reserved0), and LZ4F_compressOptions_t likewise
(stableSrc, reserved2, reserved1, reserved0), as LZ4F_decompressOptions_t.
Same sizes and offsets (ABI unchanged). A future field takes the place of a
reserved one, without changing positional initializers.
One-time source change : the former positional form { ..., { 0, 0, 0 } }
no longer compiles in C++ (warnings in C) ; examples/frameCompress.c updated.
LZ4F_INIT_PREFERENCES : { LZ4F_INIT_FRAMEINFO, 0, 0u, 0u, 0u, 0u, 0u }.
- LZ4F_srcStableUntilFlush (2) is stronger than LZ4F_srcStable (1) : in addition
to the last 64 KB of input (which remain, including after LZ4F_flush()),
all of src remains until LZ4F_flush() / LZ4F_compressEnd() returns
(with autoFlush : until the invocation returns). Docs only : the code already
relied on this (history read in place after a flush, single-threaded path).
- tests/frameMT.c : validateFlushContract : one buffer, 2 invocations separated by
a flush, everything but the last 64 KB scrambled after the flush with content
resembling upcoming data ; nbWorkers 0 and 2, levels 1 and 9, with and without
autoFlush. Scrambling the last 64 KB too is detected (contentChecksum_invalid).
Streaming test : LZ4F_srcStableUntilFlush slices come from a working copy,
scrambled the same way after each flush.
Output unchanged (same digests). Validated : full tests MT / no-MT, ASAN+UBSAN, TSAN,
make test, wine, examples (C, C++), cxxtest, CLI == dev CLI.
LZ4 examples
All examples are GPL-v2 licensed.