]> git.ipfire.org Git - thirdparty/zstd.git/commit
Add support for in-place decompression
authorNick Terrell <terrelln@fb.com>
Thu, 12 Jan 2023 02:14:40 +0000 (18:14 -0800)
committerNick Terrell <nickrterrell@gmail.com>
Fri, 13 Jan 2023 00:28:08 +0000 (16:28 -0800)
commit5b266196a41e6a15e21bd4f0eeab43b938db1d90
tree8a8ccdd54a2f1ff89a910a9bd40ad56c14d7c1ac
parent423500d1ae0c4aa5bff90c1106324ef963434667
Add support for in-place decompression

* Add a function and macro ZSTD_decompressionMargin() that computes the
  decompression margin for in-place decompression. The function computes
  a tight margin that works in all cases, and the macro computes an upper
  bound that will only work if flush isn't used.
* When doing in-place decompression, make sure that our output buffer
  doesn't overlap with the input buffer. This ensures that we don't
  decide to use the portion of the output buffer that overlaps the input
  buffer for temporary memory, like for literals.
* Add a simple unit test.
* Add in-place decompression to the simple_round_trip and
  stream_round_trip fuzzers. This should help verify that our margin stays
  correct.
lib/common/zstd_internal.h
lib/decompress/zstd_decompress.c
lib/legacy/zstd_legacy.h
lib/zstd.h
tests/fuzz/simple_round_trip.c
tests/fuzz/stream_round_trip.c
tests/fuzzer.c