~pcsx2-team/pcsx2-github-mirror/+git/zstd:vtorri

Last commit made on 2020-01-18
Get this branch:
git clone -b vtorri https://git.launchpad.net/~pcsx2-team/pcsx2-github-mirror/+git/zstd

Branch merges

Branch information

Recent commits

f37a84e... by Yann Collet <email address hidden>

fix installation with MSYS2+mingw-w64 (#1960)

Co-authored-by: vtorri <email address hidden>

76e01f3... by Nick Terrell <email address hidden>

Merge pull request #1958 from terrelln/docs

Add --single-thread to zstd --help

fa48af5... by Nick Terrell

Add --single-thread to zstd --help

957d59c... by Nick Terrell <email address hidden>

Merge pull request #1950 from terrelln/ctest

[cmake] Add playTests.sh as a test

f6d00c0... by Nick Terrell

[util] Fix readLineFromFile on Cygwin

3ed0f65... by Nick Terrell <email address hidden>

[cmake] Add playTests.sh as a test

f27b4b4... by Nick Terrell <email address hidden>

Merge pull request #1948 from lazka/cygwin-fix-c99-build

Fix the c99/cmake build under Cygwin/MSYS2

9a5d8a6... by Christoph Reiter

appveyor: build with CMake under Cygwin

036b30b... by Nick Terrell <email address hidden>

Fix super block compression and stream raw blocks in decompression (#1947)

Super blocks must never violate the zstd block bound of input_size + ZSTD_blockHeaderSize. The individual sub-blocks may, but not the super block. If the superblock violates the block bound we are liable to violate ZSTD_compressBound(), which we must not do. Whenever the super block violates the block bound we instead emit an uncompressed block.

This means we increase the latency because of the single uncompressed block. I fix this by enabling streaming an uncompressed block, so the latency of an uncompressed block is 1 byte. This doesn't reduce the latency of the buffer-less API, but I don't think we really care.

* I added a test case that verifies that the decompression has 1 byte latency.
* I rely on existing zstreamtest / fuzzer / libfuzzer regression tests for correctness. During development I had several correctness bugs, and they easily caught them.
* The added assert that the superblock doesn't violate the block bound will help us discover any missed conditions (though I think I got them all).

Credit to OSS-Fuzz.

ddd4c39... by Christoph Reiter

Fix the c99/cmake build under Cygwin/MSYS2

When building zst under cygwin or msys2 with std=c99 the build would fail because
of an undefined fileno()/_fileno(), which is used by the IS_CONSOLE() macro.

When building with -std=c99 (gcc otherwise defaults to gnu, which implies POSIX),
which is the default of the cmake build, then including unistd.h wont define
_POSIX_VERSION and all other headers also wont expose POSIX API.

To fix this make sure to define _POSIX_C_SOURCE with the version we want before including
unistd.h and so that _POSIX_VERSION is set to the version provided by the system.

Since Cygwin/MSYS2 just follow POSIX we can also remove their special cases for
defining IS_CONSOLE().

And, for completeness, also explicitly include stdio.h which is what actually declares fileno().

Tested with the normal make file and cmake under MSYS2 and Cygwin.