1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-25 01:42:11 +03:00

initial commit

This commit is contained in:
Danielle Rozenblit
2023-01-04 13:01:54 -08:00
parent ef566c8d68
commit 908e812733
328 changed files with 3340 additions and 1426 deletions

View File

@ -13,7 +13,7 @@ jobs:
make-all: make-all:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: make all - name: make all
run: make all run: make all
@ -24,7 +24,7 @@ jobs:
DEVNULLRIGHTS: 1 DEVNULLRIGHTS: 1
READFROMBLOCKDEVICE: 1 READFROMBLOCKDEVICE: 1
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: make test - name: make test
run: make test run: make test
@ -32,28 +32,28 @@ jobs:
make-test-osx: make-test-osx:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: OS-X test - name: OS-X test
run: make test # make -c lib all doesn't work because of the fact that it's not a tty run: make test # make -c lib all doesn't work because of the fact that it's not a tty
no-intrinsics-fuzztest: no-intrinsics-fuzztest:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: no intrinsics fuzztest - name: no intrinsics fuzztest
run: MOREFLAGS="-DZSTD_NO_INTRINSICS" make -C tests fuzztest run: MOREFLAGS="-DZSTD_NO_INTRINSICS" make -C tests fuzztest
tsan-zstreamtest: tsan-zstreamtest:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: thread sanitizer zstreamtest - name: thread sanitizer zstreamtest
run: CC=clang ZSTREAM_TESTTIME=-T3mn make tsan-test-zstream run: CC=clang ZSTREAM_TESTTIME=-T3mn make tsan-test-zstream
ubsan-zstreamtest: ubsan-zstreamtest:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: undefined behavior sanitizer zstreamtest - name: undefined behavior sanitizer zstreamtest
run: CC=clang make uasan-test-zstream run: CC=clang make uasan-test-zstream
@ -61,7 +61,7 @@ jobs:
tsan-fuzztest: tsan-fuzztest:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: thread sanitizer fuzztest - name: thread sanitizer fuzztest
run: CC=clang make tsan-fuzztest run: CC=clang make tsan-fuzztest
@ -69,7 +69,7 @@ jobs:
gcc-8-asan-ubsan-testzstd: gcc-8-asan-ubsan-testzstd:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: gcc-8 + ASan + UBSan + Test Zstd - name: gcc-8 + ASan + UBSan + Test Zstd
# See https://askubuntu.com/a/1428822 # See https://askubuntu.com/a/1428822
run: | run: |
@ -81,14 +81,14 @@ jobs:
clang-asan-ubsan-testzstd: clang-asan-ubsan-testzstd:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: clang + ASan + UBSan + Test Zstd - name: clang + ASan + UBSan + Test Zstd
run: CC=clang make -j uasan-test-zstd </dev/null V=1 run: CC=clang make -j uasan-test-zstd </dev/null V=1
gcc-asan-ubsan-testzstd-32bit: gcc-asan-ubsan-testzstd-32bit:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: ASan + UBSan + Test Zstd, 32bit mode - name: ASan + UBSan + Test Zstd, 32bit mode
run: | run: |
sudo apt-get -qqq update sudo apt-get -qqq update
@ -102,7 +102,7 @@ jobs:
gcc-8-asan-ubsan-fuzz: gcc-8-asan-ubsan-fuzz:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: gcc-8 + ASan + UBSan + Fuzz Test - name: gcc-8 + ASan + UBSan + Fuzz Test
# See https://askubuntu.com/a/1428822 # See https://askubuntu.com/a/1428822
run: | run: |
@ -114,14 +114,14 @@ jobs:
clang-asan-ubsan-fuzz: clang-asan-ubsan-fuzz:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: clang + ASan + UBSan + Fuzz Test - name: clang + ASan + UBSan + Fuzz Test
run: CC=clang FUZZER_FLAGS="--long-tests" make clean uasan-fuzztest run: CC=clang FUZZER_FLAGS="--long-tests" make clean uasan-fuzztest
gcc-asan-ubsan-fuzz32: gcc-asan-ubsan-fuzz32:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: ASan + UBSan + Fuzz Test 32bit - name: ASan + UBSan + Fuzz Test 32bit
run: | run: |
sudo apt-get -qqq update sudo apt-get -qqq update
@ -131,7 +131,7 @@ jobs:
clang-asan-ubsan-fuzz32: clang-asan-ubsan-fuzz32:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: clang + ASan + UBSan + Fuzz Test 32bit - name: clang + ASan + UBSan + Fuzz Test 32bit
run: | run: |
sudo apt-get -qqq update sudo apt-get -qqq update
@ -141,28 +141,28 @@ jobs:
asan-ubsan-regression: asan-ubsan-regression:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: ASan + UBSan + Regression Test - name: ASan + UBSan + Regression Test
run: make -j uasanregressiontest run: make -j uasanregressiontest
clang-ubsan-regression: clang-ubsan-regression:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: clang + ASan + UBSan + Regression Test - name: clang + ASan + UBSan + Regression Test
run: CC=clang make -j uasanregressiontest run: CC=clang make -j uasanregressiontest
msan-regression: msan-regression:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: MSan + Regression Test - name: MSan + Regression Test
run: make -j msanregressiontest run: make -j msanregressiontest
clang-msan-fuzz: clang-msan-fuzz:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: clang + MSan + Fuzz Test - name: clang + MSan + Fuzz Test
run: | run: |
sudo apt-get -qqq update sudo apt-get -qqq update
@ -173,7 +173,7 @@ jobs:
clang-msan-testzstd: clang-msan-testzstd:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: clang + MSan + Test Zstd - name: clang + MSan + Test Zstd
run: | run: |
sudo apt-get update sudo apt-get update
@ -183,7 +183,7 @@ jobs:
armfuzz: armfuzz:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Qemu ARM emulation + Fuzz Test - name: Qemu ARM emulation + Fuzz Test
run: | run: |
sudo apt-get -qqq update sudo apt-get -qqq update
@ -193,7 +193,7 @@ jobs:
valgrind-fuzz-test: valgrind-fuzz-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: valgrind + fuzz test stack mode # ~ 7mn - name: valgrind + fuzz test stack mode # ~ 7mn
shell: 'script -q -e -c "bash {0}"' shell: 'script -q -e -c "bash {0}"'
run: | run: |
@ -213,7 +213,7 @@ jobs:
{ compiler: gcc, platform: x64, action: test, script: ""}, { compiler: gcc, platform: x64, action: test, script: ""},
] ]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Mingw long test - name: Mingw long test
run: | run: |
$env:PATH_ORIGINAL = $env:PATH $env:PATH_ORIGINAL = $env:PATH
@ -279,7 +279,7 @@ jobs:
dry-run: false dry-run: false
sanitizer: ${{ matrix.sanitizer }} sanitizer: ${{ matrix.sanitizer }}
- name: Upload Crash - name: Upload Crash
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # tag=v3.1.1
if: failure() && steps.build.outcome == 'success' if: failure() && steps.build.outcome == 'success'
with: with:
name: ${{ matrix.sanitizer }}-artifacts name: ${{ matrix.sanitizer }}-artifacts

View File

@ -14,21 +14,21 @@ jobs:
linux-kernel: linux-kernel:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: linux kernel, library + build + test - name: linux kernel, library + build + test
run: make -C contrib/linux-kernel test CFLAGS="-Werror -Wunused-const-variable -Wunused-but-set-variable" run: make -C contrib/linux-kernel test CFLAGS="-Werror -Wunused-const-variable -Wunused-but-set-variable"
benchmarking: benchmarking:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: make benchmarking - name: make benchmarking
run: make benchmarking run: make benchmarking
check-32bit: # designed to catch https://github.com/facebook/zstd/issues/2428 check-32bit: # designed to catch https://github.com/facebook/zstd/issues/2428
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: make check on 32-bit - name: make check on 32-bit
run: | run: |
sudo apt update sudo apt update
@ -38,7 +38,7 @@ jobs:
check-x32: check-x32:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: make check on x32 ABI # https://en.wikipedia.org/wiki/X32_ABI - name: make check on x32 ABI # https://en.wikipedia.org/wiki/X32_ABI
env: env:
CHECK_CONSTRAINED_MEM: true CHECK_CONSTRAINED_MEM: true
@ -50,7 +50,7 @@ jobs:
gcc-7-libzstd: gcc-7-libzstd:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: gcc-7 + libzstdmt compilation - name: gcc-7 + libzstdmt compilation
# See https://askubuntu.com/a/1428822 # See https://askubuntu.com/a/1428822
run: | run: |
@ -67,7 +67,7 @@ jobs:
cmake-build-and-test-check: cmake-build-and-test-check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: cmake build and test check - name: cmake build and test check
run: | run: |
FUZZERTEST=-T1mn ZSTREAM_TESTTIME=-T1mn make cmakebuild FUZZERTEST=-T1mn ZSTREAM_TESTTIME=-T1mn make cmakebuild
@ -78,7 +78,7 @@ jobs:
cpp-gnu90-c99-compatibility: cpp-gnu90-c99-compatibility:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: C++, gnu90 and c99 compatibility - name: C++, gnu90 and c99 compatibility
run: | run: |
make cxxtest make cxxtest
@ -92,7 +92,7 @@ jobs:
mingw-cross-compilation: mingw-cross-compilation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: mingw cross-compilation - name: mingw cross-compilation
run: | run: |
# sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix; (doesn't work) # sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix; (doesn't work)
@ -103,7 +103,7 @@ jobs:
armbuild: armbuild:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: ARM Build Test - name: ARM Build Test
run: | run: |
sudo apt-get -qqq update sudo apt-get -qqq update
@ -113,7 +113,7 @@ jobs:
bourne-shell: bourne-shell:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Bourne shell compatibility (shellcheck) - name: Bourne shell compatibility (shellcheck)
run: | run: |
wget https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.x86_64.tar.xz wget https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.x86_64.tar.xz
@ -123,7 +123,7 @@ jobs:
zlib-wrapper: zlib-wrapper:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: zlib wrapper test - name: zlib wrapper test
run: | run: |
sudo apt-get -qqq update sudo apt-get -qqq update
@ -134,7 +134,7 @@ jobs:
lz4-threadpool-libs: lz4-threadpool-libs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: LZ4, thread pool, and libs build testslib wrapper test - name: LZ4, thread pool, and libs build testslib wrapper test
run: | run: |
make lz4install make lz4install
@ -148,7 +148,7 @@ jobs:
gcc-make-tests-32bit: gcc-make-tests-32bit:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Make all, 32bit mode - name: Make all, 32bit mode
run: | run: |
sudo apt-get -qqq update sudo apt-get -qqq update
@ -158,7 +158,7 @@ jobs:
gcc-8-make: gcc-8-make:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: gcc-8 build - name: gcc-8 build
# See https://askubuntu.com/a/1428822 # See https://askubuntu.com/a/1428822
run: | run: |
@ -170,7 +170,7 @@ jobs:
implicit-fall-through: implicit-fall-through:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: -Wimplicit-fallthrough build - name: -Wimplicit-fallthrough build
run: | run: |
make clean make clean
@ -178,6 +178,51 @@ jobs:
make clean make clean
CC=clang MOREFLAGS="-Werror -Wimplicit-fallthrough -O0" make -C lib -j libzstd.a ZSTD_LEGACY_SUPPORT=0 CC=clang MOREFLAGS="-Werror -Wimplicit-fallthrough -O0" make -C lib -j libzstd.a ZSTD_LEGACY_SUPPORT=0
meson-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Install packages
run: |
sudo apt-get update
sudo apt-get -y install build-essential python3-pip ninja-build liblz4-dev
pip install --pre meson
- name: Build with Meson
run: |
meson setup \
--buildtype=debugoptimized \
-Db_lundef=false \
-Dauto_features=enabled \
-Dbin_programs=true \
-Dbin_tests=true \
-Dbin_contrib=true \
-Ddefault_library=both \
build/meson builddir
ninja -C builddir/
meson test -C builddir/ --print-errorlogs
meson install -C builddir --destdir staging/
meson-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Install packages
run: pip install --pre meson
- name: Initialize the MSVC dev command prompt
uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d
- name: Configure with Meson
run: |
meson setup build/meson/ builddir -Dbin_tests=true -Dbin_programs=true -Dbin_contrib=true
- name: Build with Meson
run: |
ninja -C builddir/
- name: Test with Meson
run: |
meson test -C builddir/ --print-errorlogs
- name: Install with Meson
run: |
meson install -C builddir --destdir staging/
cmake-visual-2019: cmake-visual-2019:
runs-on: windows-2019 runs-on: windows-2019
strategy: strategy:
@ -189,9 +234,9 @@ jobs:
flags: "-A Win32" flags: "-A Win32"
- generator: "MinGW Makefiles" - generator: "MinGW Makefiles"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Add MSBuild to PATH - name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.1.3 uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # tag=v1.1.3
- name: Build - name: Build
working-directory: ${{env.GITHUB_WORKSPACE}} working-directory: ${{env.GITHUB_WORKSPACE}}
run: | run: |
@ -208,9 +253,9 @@ jobs:
platform: [x64, Win32] platform: [x64, Win32]
configuration: [Debug, Release] configuration: [Debug, Release]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Add MSBuild to PATH - name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.1.3 uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # tag=v1.1.3
- name: Build - name: Build
working-directory: ${{env.GITHUB_WORKSPACE}} working-directory: ${{env.GITHUB_WORKSPACE}}
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
@ -227,19 +272,33 @@ jobs:
# platform: [x64, Win32] # platform: [x64, Win32]
# configuration: [Debug, Release] # configuration: [Debug, Release]
# steps: # steps:
# - uses: actions/checkout@v3 # - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
# - name: Add MSBuild to PATH # - name: Add MSBuild to PATH
# uses: microsoft/setup-msbuild@v1.1.3 # uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # tag=v1.1.3
# - name: Build # - name: Build
# working-directory: ${{env.GITHUB_WORKSPACE}} # working-directory: ${{env.GITHUB_WORKSPACE}}
# run: > # run: >
# msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 # msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140
# /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}} # /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}}
# This tests that we don't accidently grow the size too much.
# If the size grows intentionally, you can raise these numbers.
# But we do need to think about binary size, since it is a concern.
libzstd-size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: libzstd size test
run: |
make clean && make -j -C lib libzstd && ./tests/check_size.py lib/libzstd.so 1100000
make clean && make -j -C lib libzstd ZSTD_LIB_COMPRESSION=0 ZSTD_LIB_DICTBUILDER=0 && ./tests/check_size.py lib/libzstd.so 400000
make clean && make -j -C lib libzstd ZSTD_LIB_MINIFY=1 && ./tests/check_size.py lib/libzstd.so 300000
make clean && make -j -C lib libzstd ZSTD_LIB_MINIFY=1 ZSTD_LIB_COMPRESSION=0 ZSTD_LIB_DICTBUILDER=0 && ./tests/check_size.py lib/libzstd.so 80000
minimal-decompressor-macros: minimal-decompressor-macros:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: minimal decompressor macros - name: minimal decompressor macros
run: | run: |
make clean && make -j all ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror" make clean && make -j all ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror"
@ -254,7 +313,7 @@ jobs:
dynamic-bmi2: dynamic-bmi2:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: dynamic bmi2 tests - name: dynamic bmi2 tests
run: | run: |
make clean && make -j check MOREFLAGS="-O0 -Werror -mbmi2" make clean && make -j check MOREFLAGS="-O0 -Werror -mbmi2"
@ -266,7 +325,7 @@ jobs:
test-variants: test-variants:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: make all variants & validate - name: make all variants & validate
run: | run: |
make -j -C programs allVariants MOREFLAGS=-O0 make -j -C programs allVariants MOREFLAGS=-O0
@ -292,7 +351,7 @@ jobs:
XCC: ${{ matrix.xcc }} XCC: ${{ matrix.xcc }}
XEMU: ${{ matrix.xemu }} XEMU: ${{ matrix.xemu }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: apt update & install - name: apt update & install
run: | run: |
sudo apt-get update sudo apt-get update
@ -345,7 +404,7 @@ jobs:
{ compiler: clang, platform: x64, script: "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd V=1"}, { compiler: clang, platform: x64, script: "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd V=1"},
] ]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Mingw short test - name: Mingw short test
run: | run: |
ECHO "Building ${{matrix.compiler}} ${{matrix.platform}}" ECHO "Building ${{matrix.compiler}} ${{matrix.platform}}"
@ -378,9 +437,9 @@ jobs:
platform: [x64, Win32] platform: [x64, Win32]
configuration: [Release] configuration: [Release]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Add MSBuild to PATH - name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.1.3 uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # tag=v1.1.3
- name: Build and run tests - name: Build and run tests
working-directory: ${{env.GITHUB_WORKSPACE}} working-directory: ${{env.GITHUB_WORKSPACE}}
env: env:
@ -398,7 +457,7 @@ jobs:
intel-cet-compatibility: intel-cet-compatibility:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Build Zstd - name: Build Zstd
run: | run: |
make -j zstd V=1 make -j zstd V=1
@ -419,7 +478,7 @@ jobs:
container: container:
image: debian:testing image: debian:testing
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Install dependencies - name: Install dependencies
run: | run: |
apt -y update apt -y update
@ -431,18 +490,21 @@ jobs:
cc -Wall -Wextra -Wpedantic -Werror -o simple examples/simple_compression.c $(pkg-config --cflags --libs libzstd) cc -Wall -Wextra -Wpedantic -Werror -o simple examples/simple_compression.c $(pkg-config --cflags --libs libzstd)
./simple LICENSE ./simple LICENSE
versions-compatibility:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Versions Compatibility Test
run: |
make -C tests versionsTest
# This test currently fails on Github Actions specifically. clangbuild:
# Possible reason : TTY emulation. runs-on: ubuntu-latest
# Note that the same test works fine locally and on travisCI. steps:
# This will have to be fixed before transferring the test to GA. - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
# versions-compatibility: - name: make clangbuild
# runs-on: ubuntu-latest run: |
# steps: make clangbuild
# - uses: actions/checkout@v3
# - name: Versions Compatibility Test
# run: |
# make -C tests versionsTest
# For reference : icc tests # For reference : icc tests
@ -463,7 +525,7 @@ jobs:
# sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" # sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
# sudo apt-get update # sudo apt-get update
# sudo apt-get install -y intel-basekit intel-hpckit # sudo apt-get install -y intel-basekit intel-hpckit
# - uses: actions/checkout@v3 # - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
# - name: make check # - name: make check
# run: | # run: |
# make CC=/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc check # make CC=/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc check

View File

@ -19,7 +19,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
- name: Archive - name: Archive
env: env:

View File

@ -27,12 +27,12 @@ jobs:
steps: steps:
- name: "Checkout code" - name: "Checkout code"
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0 uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3
with: with:
persist-credentials: false persist-credentials: false
- name: "Run analysis" - name: "Run analysis"
uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # tag=v2.0.6 uses: ossf/scorecard-action@937ffa90d79c7d720498178154ad4c7ba1e4ad8c # tag=v2.1.0
with: with:
results_file: results.sarif results_file: results.sarif
results_format: sarif results_format: sarif
@ -51,7 +51,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab. # format to the repository Actions tab.
- name: "Upload artifact" - name: "Upload artifact"
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # tag=v3.0.0 uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # tag=v3.1.1
with: with:
name: SARIF file name: SARIF file
path: results.sarif path: results.sarif
@ -59,6 +59,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard. # Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning" - name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # tag=v1.0.26 uses: github/codeql-action/upload-sarif@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # tag=v2.1.37
with: with:
sarif_file: results.sarif sarif_file: results.sarif

View File

@ -2,7 +2,7 @@ BSD License
For Zstandard software For Zstandard software
Copyright (c) 2016-present, Facebook, Inc. All rights reserved. Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: are permitted provided that the following conditions are met:
@ -14,9 +14,9 @@ are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution. and/or other materials provided with the distribution.
* Neither the name Facebook nor the names of its contributors may be used to * Neither the name Facebook, nor Meta, nor the names of its contributors may
endorse or promote products derived from this software without specific be used to endorse or promote products derived from this software without
prior written permission. specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2015-2021, Yann Collet, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the
@ -123,6 +123,7 @@ contrib: lib
$(MAKE) -C contrib/seekable_format/examples all $(MAKE) -C contrib/seekable_format/examples all
$(MAKE) -C contrib/seekable_format/tests test $(MAKE) -C contrib/seekable_format/tests test
$(MAKE) -C contrib/largeNbDicts all $(MAKE) -C contrib/largeNbDicts all
$(MAKE) -C contrib/externalMatchfinder all
cd build/single_file_libs/ ; ./build_decoder_test.sh cd build/single_file_libs/ ; ./build_decoder_test.sh
cd build/single_file_libs/ ; ./build_library_test.sh cd build/single_file_libs/ ; ./build_library_test.sh
@ -142,6 +143,7 @@ clean:
$(Q)$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID) $(Q)$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID)
$(Q)$(MAKE) -C contrib/seekable_format/tests $@ > $(VOID) $(Q)$(MAKE) -C contrib/seekable_format/tests $@ > $(VOID)
$(Q)$(MAKE) -C contrib/largeNbDicts $@ > $(VOID) $(Q)$(MAKE) -C contrib/largeNbDicts $@ > $(VOID)
$(Q)$(MAKE) -C contrib/externalMatchfinder $@ > $(VOID)
$(Q)$(RM) zstd$(EXT) zstdmt$(EXT) tmp* $(Q)$(RM) zstd$(EXT) zstdmt$(EXT) tmp*
$(Q)$(RM) -r lz4 $(Q)$(RM) -r lz4
@echo Cleaning completed @echo Cleaning completed

View File

@ -32,11 +32,11 @@ BEGIN
BEGIN BEGIN
BLOCK "040904B0" BLOCK "040904B0"
BEGIN BEGIN
VALUE "CompanyName", "Yann Collet, Facebook, Inc." VALUE "CompanyName", "Meta Platforms, Inc."
VALUE "FileDescription", "Zstandard - Fast and efficient compression algorithm" VALUE "FileDescription", "Zstandard - Fast and efficient compression algorithm"
VALUE "FileVersion", ZSTD_VERSION_STRING VALUE "FileVersion", ZSTD_VERSION_STRING
VALUE "InternalName", "libzstd.dll" VALUE "InternalName", "libzstd.dll"
VALUE "LegalCopyright", "Copyright (c) 2013-present, Yann Collet, Facebook, Inc." VALUE "LegalCopyright", "Copyright (c) Meta Platforms, Inc. and affiliates."
VALUE "OriginalFilename", "libzstd.dll" VALUE "OriginalFilename", "libzstd.dll"
VALUE "ProductName", "Zstandard" VALUE "ProductName", "Zstandard"
VALUE "ProductVersion", ZSTD_VERSION_STRING VALUE "ProductVersion", ZSTD_VERSION_STRING

View File

@ -32,11 +32,11 @@ BEGIN
BEGIN BEGIN
BLOCK "040904B0" BLOCK "040904B0"
BEGIN BEGIN
VALUE "CompanyName", "Yann Collet, Facebook, Inc." VALUE "CompanyName", "Meta Platforms, Inc."
VALUE "FileDescription", "Zstandard - Fast and efficient compression algorithm" VALUE "FileDescription", "Zstandard - Fast and efficient compression algorithm"
VALUE "FileVersion", ZSTD_VERSION_STRING VALUE "FileVersion", ZSTD_VERSION_STRING
VALUE "InternalName", "zstd.exe" VALUE "InternalName", "zstd.exe"
VALUE "LegalCopyright", "Copyright (c) 2013-present, Yann Collet, Facebook, Inc." VALUE "LegalCopyright", "Copyright (c) Meta Platforms, Inc. and affiliates."
VALUE "OriginalFilename", "zstd.exe" VALUE "OriginalFilename", "zstd.exe"
VALUE "ProductName", "Zstandard" VALUE "ProductName", "Zstandard"
VALUE "ProductVersion", ZSTD_VERSION_STRING VALUE "ProductVersion", ZSTD_VERSION_STRING

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the
@ -8,18 +8,18 @@
# ################################################################ # ################################################################
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
# As of 2018-12-26 ZSTD has been validated to build with cmake version 3.13.2 new policies. # As of 2018-12-26 ZSTD has been validated to build with cmake version 3.13.2 new policies.
# Set and use the newest cmake policies that are validated to work # Set and use the newest cmake policies that are validated to work
set(ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION "3") set(ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION "3")
set(ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION "13") #Policies never changed at PATCH level set(ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION "13") #Policies never changed at PATCH level
if("${CMAKE_MAJOR_VERSION}" LESS 3) if("${CMAKE_MAJOR_VERSION}" LESS 3)
set(ZSTD_CMAKE_POLICY_VERSION "${CMAKE_VERSION}") set(ZSTD_CMAKE_POLICY_VERSION "${CMAKE_VERSION}")
elseif( "${ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION}" EQUAL "${CMAKE_MAJOR_VERSION}" AND elseif( "${ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION}" EQUAL "${CMAKE_MAJOR_VERSION}" AND
"${ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION}" GREATER "${CMAKE_MINOR_VERSION}") "${ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION}" GREATER "${CMAKE_MINOR_VERSION}")
set(ZSTD_CMAKE_POLICY_VERSION "${CMAKE_VERSION}") set(ZSTD_CMAKE_POLICY_VERSION "${CMAKE_VERSION}")
else() else()
set(ZSTD_CMAKE_POLICY_VERSION "${ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION}.${ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION}.0") set(ZSTD_CMAKE_POLICY_VERSION "${ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION}.${ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION}.0")
endif() endif()
cmake_policy(VERSION ${ZSTD_CMAKE_POLICY_VERSION}) cmake_policy(VERSION ${ZSTD_CMAKE_POLICY_VERSION})
@ -40,11 +40,13 @@ if( CMAKE_MAJOR_VERSION LESS 3 )
set(PROJECT_VERSION_PATCH ${zstd_VERSION_PATCH}) set(PROJECT_VERSION_PATCH ${zstd_VERSION_PATCH})
set(PROJECT_VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}") set(PROJECT_VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}")
enable_language(C) # Main library is in C enable_language(C) # Main library is in C
enable_language(ASM) # And ASM
enable_language(CXX) # Testing contributed code also utilizes CXX enable_language(CXX) # Testing contributed code also utilizes CXX
else() else()
project(zstd project(zstd
VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}" VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}"
LANGUAGES C # Main library is in C LANGUAGES C # Main library is in C
ASM # And ASM
CXX # Testing contributed code also utilizes CXX CXX # Testing contributed code also utilizes CXX
) )
endif() endif()

View File

@ -1,7 +1,8 @@
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
include(CheckLinkerFlag)
function(EnableCompilerFlag _flag _C _CXX) function(EnableCompilerFlag _flag _C _CXX _LD)
string(REGEX REPLACE "\\+" "PLUS" varname "${_flag}") string(REGEX REPLACE "\\+" "PLUS" varname "${_flag}")
string(REGEX REPLACE "[^A-Za-z0-9]+" "_" varname "${varname}") string(REGEX REPLACE "[^A-Za-z0-9]+" "_" varname "${varname}")
string(REGEX REPLACE "^_+" "" varname "${varname}") string(REGEX REPLACE "^_+" "" varname "${varname}")
@ -18,6 +19,13 @@ function(EnableCompilerFlag _flag _C _CXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}" PARENT_SCOPE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}" PARENT_SCOPE)
endif () endif ()
endif () endif ()
if (_LD)
CHECK_LINKER_FLAG(C ${_flag} LD_FLAG_${varname})
if (LD_FLAG_${varname})
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_flag}" PARENT_SCOPE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${_flag}" PARENT_SCOPE)
endif ()
endif ()
endfunction() endfunction()
macro(ADD_ZSTD_COMPILATION_FLAGS) macro(ADD_ZSTD_COMPILATION_FLAGS)
@ -30,33 +38,39 @@ macro(ADD_ZSTD_COMPILATION_FLAGS)
# EnableCompilerFlag("-std=c99" true false) # Set C compiation to c99 standard # EnableCompilerFlag("-std=c99" true false) # Set C compiation to c99 standard
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND MSVC) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND MSVC)
# clang-cl normally maps -Wall to -Weverything. # clang-cl normally maps -Wall to -Weverything.
EnableCompilerFlag("/clang:-Wall" true true) EnableCompilerFlag("/clang:-Wall" true true false)
else () else ()
EnableCompilerFlag("-Wall" true true) EnableCompilerFlag("-Wall" true true false)
endif () endif ()
EnableCompilerFlag("-Wextra" true true) EnableCompilerFlag("-Wextra" true true false)
EnableCompilerFlag("-Wundef" true true) EnableCompilerFlag("-Wundef" true true false)
EnableCompilerFlag("-Wshadow" true true) EnableCompilerFlag("-Wshadow" true true false)
EnableCompilerFlag("-Wcast-align" true true) EnableCompilerFlag("-Wcast-align" true true false)
EnableCompilerFlag("-Wcast-qual" true true) EnableCompilerFlag("-Wcast-qual" true true false)
EnableCompilerFlag("-Wstrict-prototypes" true false) EnableCompilerFlag("-Wstrict-prototypes" true false false)
# Enable asserts in Debug mode # Enable asserts in Debug mode
if (CMAKE_BUILD_TYPE MATCHES "Debug") if (CMAKE_BUILD_TYPE MATCHES "Debug")
EnableCompilerFlag("-DDEBUGLEVEL=1" true true) EnableCompilerFlag("-DDEBUGLEVEL=1" true true false)
endif () endif ()
# Add noexecstack flags
# LDFLAGS
EnableCompilerFlag("-z noexecstack" false false true)
# CFLAGS & CXXFLAGS
EnableCompilerFlag("-Qunused-arguments" true true false)
EnableCompilerFlag("-Wa,--noexecstack" true true false)
elseif (MSVC) # Add specific compilation flags for Windows Visual elseif (MSVC) # Add specific compilation flags for Windows Visual
set(ACTIVATE_MULTITHREADED_COMPILATION "ON" CACHE BOOL "activate multi-threaded compilation (/MP flag)") set(ACTIVATE_MULTITHREADED_COMPILATION "ON" CACHE BOOL "activate multi-threaded compilation (/MP flag)")
if (CMAKE_GENERATOR MATCHES "Visual Studio" AND ACTIVATE_MULTITHREADED_COMPILATION) if (CMAKE_GENERATOR MATCHES "Visual Studio" AND ACTIVATE_MULTITHREADED_COMPILATION)
EnableCompilerFlag("/MP" true true) EnableCompilerFlag("/MP" true true false)
endif () endif ()
# UNICODE SUPPORT # UNICODE SUPPORT
EnableCompilerFlag("/D_UNICODE" true true) EnableCompilerFlag("/D_UNICODE" true true false)
EnableCompilerFlag("/DUNICODE" true true) EnableCompilerFlag("/DUNICODE" true true false)
# Enable asserts in Debug mode # Enable asserts in Debug mode
if (CMAKE_BUILD_TYPE MATCHES "Debug") if (CMAKE_BUILD_TYPE MATCHES "Debug")
EnableCompilerFlag("/DDEBUGLEVEL=1" true true) EnableCompilerFlag("/DDEBUGLEVEL=1" true true false)
endif () endif ()
endif () endif ()

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2016-present, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the
@ -77,6 +77,12 @@ if (MSVC)
set(PlatformDependResources ${MSVC_RESOURCE_DIR}/libzstd-dll.rc) set(PlatformDependResources ${MSVC_RESOURCE_DIR}/libzstd-dll.rc)
endif () endif ()
# Explicitly set the language to C for all files, including ASM files.
# Our assembly expects to be compiled by a C compiler, and is only enabled for
# __GNUC__ compatible compilers. Otherwise all the ASM code is disabled by
# macros.
set_source_files_properties(${Sources} PROPERTIES LANGUAGE C)
# Split project to static and shared libraries build # Split project to static and shared libraries build
set(library_targets) set(library_targets)
if (ZSTD_BUILD_SHARED) if (ZSTD_BUILD_SHARED)

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,6 +1,6 @@
# ################################################################ # ################################################################
# zstd - Makefile # zstd - Makefile
# Copyright (C) Yann Collet 2014-present # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# BSD license # BSD license
@ -81,7 +81,7 @@ add_test(NAME fuzzer COMMAND fuzzer ${ZSTD_FUZZER_FLAGS})
# #
# zstreamtest # zstreamtest
# #
add_executable(zstreamtest ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${TESTS_DIR}/seqgen.c ${TESTS_DIR}/zstreamtest.c) add_executable(zstreamtest ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${TESTS_DIR}/seqgen.c ${TESTS_DIR}/zstreamtest.c ${TESTS_DIR}/external_matchfinder.c)
if (NOT MSVC) if (NOT MSVC)
target_compile_options(zstreamtest PRIVATE "-Wno-deprecated-declarations") target_compile_options(zstreamtest PRIVATE "-Wno-deprecated-declarations")
endif() endif()
@ -96,13 +96,14 @@ add_test(NAME zstreamtest COMMAND zstreamtest ${ZSTD_ZSTREAM_FLAGS})
AddTestFlagsOption(ZSTD_PLAYTESTS_FLAGS "$ENV{PLAYTESTS_FLAGS}" AddTestFlagsOption(ZSTD_PLAYTESTS_FLAGS "$ENV{PLAYTESTS_FLAGS}"
"Semicolon-separated list of flags to pass to the playTests.sh test") "Semicolon-separated list of flags to pass to the playTests.sh test")
add_test(NAME playTests COMMAND sh -c "\"${TESTS_DIR}/playTests.sh\" ${ZSTD_PLAYTESTS_FLAGS}") add_test(NAME playTests COMMAND sh -c "\"${TESTS_DIR}/playTests.sh\" ${ZSTD_PLAYTESTS_FLAGS}")
if (ZSTD_BUILD_PROGRAMS) find_program(UNAME uname) # Run script only in unix shell environments
if (ZSTD_BUILD_PROGRAMS AND UNAME)
set_property(TEST playTests APPEND PROPERTY ENVIRONMENT set_property(TEST playTests APPEND PROPERTY ENVIRONMENT
"ZSTD_BIN=$<TARGET_FILE:zstd>" "ZSTD_BIN=$<TARGET_FILE:zstd>"
"DATAGEN_BIN=$<TARGET_FILE:datagen>" "DATAGEN_BIN=$<TARGET_FILE:datagen>"
) )
else() else()
message(STATUS "Disabling playTests.sh test because ZSTD_BUILD_PROGRAMS is not enabled") message(STATUS "Disabling playTests.sh test because requirements not met")
set_tests_properties(playTests PROPERTIES DISABLED YES) set_tests_properties(playTests PROPERTIES DISABLED YES)
endif() endif()

View File

@ -21,7 +21,6 @@ FUZZER_FLAGS = ['--no-big-tests']
FUZZERTEST = '-T200s' FUZZERTEST = '-T200s'
ZSTREAM_TESTTIME = '-T90s' ZSTREAM_TESTTIME = '-T90s'
DECODECORPUS_TESTTIME = '-T30' DECODECORPUS_TESTTIME = '-T30'
ZSTDRTTEST = ['--test-large-data']
# ============================================================================= # =============================================================================
# Executables # Executables
@ -66,8 +65,10 @@ fuzzer = executable('fuzzer',
dependencies: [ testcommon_dep, thread_dep ], dependencies: [ testcommon_dep, thread_dep ],
install: false) install: false)
zstreamtest_sources = [join_paths(zstd_rootdir, 'tests/seqgen.c'), zstreamtest_sources = [
join_paths(zstd_rootdir, 'tests/zstreamtest.c')] join_paths(zstd_rootdir, 'tests/seqgen.c'),
join_paths(zstd_rootdir, 'tests/zstreamtest.c'),
join_paths(zstd_rootdir, 'tests/external_matchfinder.c')]
zstreamtest = executable('zstreamtest', zstreamtest = executable('zstreamtest',
zstreamtest_sources, zstreamtest_sources,
include_directories: test_includes, include_directories: test_includes,
@ -134,24 +135,38 @@ checkTag = executable('checkTag',
# ============================================================================= # =============================================================================
if tests_supported_oses.contains(host_machine_os) if tests_supported_oses.contains(host_machine_os)
valgrind_prog = find_program('valgrind', ['/usr/bin/valgrind'], required: true) valgrind_prog = find_program('valgrind', ['/usr/bin/valgrind'], required: false)
valgrindTest_py = files('valgrindTest.py') valgrindTest_py = files('valgrindTest.py')
test('valgrindTest', if valgrind_prog.found()
valgrindTest_py, test('valgrindTest',
args: [valgrind_prog.path(), zstd, datagen, fuzzer, fullbench], valgrindTest_py,
depends: [zstd, datagen, fuzzer, fullbench], args: [valgrind_prog.path(), zstd, datagen, fuzzer, fullbench],
timeout: 600) # Timeout should work on HDD drive depends: [zstd, datagen, fuzzer, fullbench],
timeout: 600) # Timeout should work on HDD drive
endif
endif endif
if host_machine_os != os_windows if host_machine_os != os_windows
playTests_sh = find_program(join_paths(zstd_rootdir, 'tests/playTests.sh'), required: true) playTests_sh = find_program(join_paths(zstd_rootdir, 'tests/playTests.sh'), required: true)
test('test-zstd',
playTests_sh, # add slow tests only if the meson version is new enough to support
args: ZSTDRTTEST, # test setups with default-excluded suites
env: ['ZSTD_BIN=' + zstd.full_path(), 'DATAGEN_BIN=./datagen'], if meson.version().version_compare('>=0.57.0')
depends: [datagen], matrix = {'fast': [], 'slow': ['--test-large-data']}
workdir: meson.current_build_dir(), else
timeout: 2800) # Timeout should work on HDD drive matrix = {'fast': []}
endif
foreach suite, opt: matrix
test('test-zstd-'+suite,
playTests_sh,
args: opt,
env: ['ZSTD_BIN=' + zstd.full_path(), 'DATAGEN_BIN=./datagen'],
depends: [datagen],
suite: suite,
workdir: meson.current_build_dir(),
timeout: 2800) # Timeout should work on HDD drive
endforeach
endif endif
test('test-fullbench-1', test('test-fullbench-1',
@ -190,3 +205,11 @@ test('test-decodecorpus',
args: ['-t', DECODECORPUS_TESTTIME], args: ['-t', DECODECORPUS_TESTTIME],
timeout: 60) timeout: 60)
test('test-poolTests', poolTests) # should be fast test('test-poolTests', poolTests) # should be fast
if meson.version().version_compare('>=0.57.0')
add_test_setup('fast',
is_default: true,
exclude_suites: ['slow'])
add_test_setup('slow',
exclude_suites: ['fast'])
endif

View File

@ -8,7 +8,7 @@
* \endcode * \endcode
*/ */
/* /*
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -8,7 +8,7 @@
* \endcode * \endcode
*/ */
/* /*
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2019-present, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -0,0 +1,2 @@
# build artifacts
externalMatchfinder

View File

@ -0,0 +1,40 @@
# ################################################################
# Copyright (c) Yann Collet, Meta Platforms, Inc.
# All rights reserved.
#
# This source code is licensed under both the BSD-style license (found in the
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
# in the COPYING file in the root directory of this source tree).
# ################################################################
PROGDIR = ../../programs
LIBDIR = ../../lib
LIBZSTD = $(LIBDIR)/libzstd.a
CPPFLAGS+= -I$(LIBDIR) -I$(LIBDIR)/compress -I$(LIBDIR)/common
CFLAGS ?= -O3
CFLAGS += -std=gnu99
DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-aliasing=1 -Wswitch-enum \
-Wstrict-prototypes -Wundef -Wpointer-arith \
-Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
-Wredundant-decls
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
default: externalMatchfinder
all: externalMatchfinder
externalMatchfinder: matchfinder.c main.c $(LIBZSTD)
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
.PHONY: $(LIBZSTD)
$(LIBZSTD):
$(MAKE) -C $(LIBDIR) libzstd.a CFLAGS="$(CFLAGS)"
clean:
$(RM) *.o
$(MAKE) -C $(LIBDIR) clean > /dev/null
$(RM) externalMatchfinder

View File

@ -0,0 +1,14 @@
externalMatchfinder
=====================
`externalMatchfinder` is a test tool for the external matchfinder API.
It demonstrates how to use the API to perform a simple round-trip test.
A sample matchfinder is provided in matchfinder.c, but the user can swap
this out with a different one if desired. The sample matchfinder implements
LZ compression with a 1KB hashtable. Dictionary compression is not currently supported.
Command line :
```
externalMatchfinder filename
```

View File

@ -0,0 +1,107 @@
/*
* Copyright (c) Yann Collet, Meta Platforms, Inc.
* All rights reserved.
*
* This source code is licensed under both the BSD-style license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define ZSTD_STATIC_LINKING_ONLY
#include "zstd.h"
#include "zstd_errors.h"
#include "matchfinder.h" // simpleExternalMatchFinder
#define CHECK(res) \
do { \
if (ZSTD_isError(res)) { \
printf("ERROR: %s\n", ZSTD_getErrorName(res)); \
return 1; \
} \
} while (0) \
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("Usage: exampleMatchfinder <file>\n");
return 1;
}
ZSTD_CCtx* const zc = ZSTD_createCCtx();
int simpleExternalMatchState = 0xdeadbeef;
// Here is the crucial bit of code!
ZSTD_registerExternalMatchFinder(
zc,
&simpleExternalMatchState,
simpleExternalMatchFinder
);
{
size_t const res = ZSTD_CCtx_setParameter(zc, ZSTD_c_enableMatchFinderFallback, 1);
CHECK(res);
}
FILE *f = fopen(argv[1], "rb");
assert(f);
{
int const ret = fseek(f, 0, SEEK_END);
assert(ret == 0);
}
size_t const srcSize = ftell(f);
{
int const ret = fseek(f, 0, SEEK_SET);
assert(ret == 0);
}
char* const src = malloc(srcSize + 1);
assert(src);
{
size_t const ret = fread(src, srcSize, 1, f);
assert(ret == 1);
int const ret2 = fclose(f);
assert(ret2 == 0);
}
size_t const dstSize = ZSTD_compressBound(srcSize);
char* const dst = malloc(dstSize);
assert(dst);
size_t const cSize = ZSTD_compress2(zc, dst, dstSize, src, srcSize);
CHECK(cSize);
char* const val = malloc(srcSize);
assert(val);
{
size_t const res = ZSTD_decompress(val, srcSize, dst, cSize);
CHECK(res);
}
if (memcmp(src, val, srcSize) == 0) {
printf("Compression and decompression were successful!\n");
printf("Original size: %lu\n", srcSize);
printf("Compressed size: %lu\n", cSize);
} else {
printf("ERROR: input and validation buffers don't match!\n");
for (size_t i = 0; i < srcSize; i++) {
if (src[i] != val[i]) {
printf("First bad index: %zu\n", i);
break;
}
}
return 1;
}
ZSTD_freeCCtx(zc);
free(src);
free(dst);
free(val);
return 0;
}

View File

@ -0,0 +1,80 @@
/*
* Copyright (c) Yann Collet, Meta Platforms, Inc.
* All rights reserved.
*
* This source code is licensed under both the BSD-style license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
*/
#include "zstd_compress_internal.h"
#include "matchfinder.h"
#define HSIZE 1024
static U32 const HLOG = 10;
static U32 const MLS = 4;
static U32 const BADIDX = 0xffffffff;
size_t simpleExternalMatchFinder(
void* externalMatchState,
ZSTD_Sequence* outSeqs, size_t outSeqsCapacity,
const void* src, size_t srcSize,
const void* dict, size_t dictSize,
int compressionLevel,
size_t windowSize
) {
const BYTE* const istart = (const BYTE*)src;
const BYTE* const iend = istart + srcSize;
const BYTE* ip = istart;
const BYTE* anchor = istart;
size_t seqCount = 0;
U32 hashTable[HSIZE];
(void)externalMatchState;
(void)dict;
(void)dictSize;
(void)outSeqsCapacity;
(void)compressionLevel;
{ int i;
for (i=0; i < HSIZE; i++) {
hashTable[i] = BADIDX;
} }
while (ip + MLS < iend) {
size_t const hash = ZSTD_hashPtr(ip, HLOG, MLS);
U32 const matchIndex = hashTable[hash];
hashTable[hash] = (U32)(ip - istart);
if (matchIndex != BADIDX) {
const BYTE* const match = istart + matchIndex;
U32 const matchLen = (U32)ZSTD_count(ip, match, iend);
if (matchLen >= ZSTD_MINMATCH_MIN) {
U32 const litLen = (U32)(ip - anchor);
U32 const offset = (U32)(ip - match);
ZSTD_Sequence const seq = {
offset, litLen, matchLen, 0
};
/* Note: it's crucial to stay within the window size! */
if (offset <= windowSize) {
outSeqs[seqCount++] = seq;
ip += matchLen;
anchor = ip;
continue;
}
}
}
ip++;
}
{ ZSTD_Sequence const finalSeq = {
0, (U32)(iend - anchor), 0, 0
};
outSeqs[seqCount++] = finalSeq;
}
return seqCount;
}

View File

@ -0,0 +1,26 @@
/*
* Copyright (c) Yann Collet, Meta Platforms, Inc.
* All rights reserved.
*
* This source code is licensed under both the BSD-style license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
*/
#ifndef MATCHFINDER_H
#define MATCHFINDER_H
#define ZSTD_STATIC_LINKING_ONLY
#include "zstd.h"
size_t simpleExternalMatchFinder(
void* externalMatchState,
ZSTD_Sequence* outSeqs, size_t outSeqsCapacity,
const void* src, size_t srcSize,
const void* dict, size_t dictSize,
int compressionLevel,
size_t windowSize
);
#endif

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# ################################################################ # ################################################################
# Copyright (c) 2021-2021, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2016-present, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Przemyslaw Skibinski, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2018-present, Yann Collet, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018-present, Yann Collet, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the
@ -856,7 +856,7 @@ int bench(const char **fileNameTable, unsigned nbFiles, const char *dictionary,
CONTROL(cTotalSizeNoDict != 0); CONTROL(cTotalSizeNoDict != 0);
DISPLAYLEVEL(3, "compressing at level %u without dictionary : Ratio=%.2f (%u bytes) \n", DISPLAYLEVEL(3, "compressing at level %u without dictionary : Ratio=%.2f (%u bytes) \n",
clevel, clevel,
(double)totalSrcSlicesSize / cTotalSizeNoDict, (unsigned)cTotalSizeNoDict); (double)totalSrcSlicesSize / (double)cTotalSizeNoDict, (unsigned)cTotalSizeNoDict);
size_t* const cSizes = malloc(nbBlocks * sizeof(size_t)); size_t* const cSizes = malloc(nbBlocks * sizeof(size_t));
CONTROL(cSizes != NULL); CONTROL(cSizes != NULL);
@ -865,7 +865,7 @@ int bench(const char **fileNameTable, unsigned nbFiles, const char *dictionary,
CONTROL(cTotalSize != 0); CONTROL(cTotalSize != 0);
DISPLAYLEVEL(3, "compressed using a %u bytes dictionary : Ratio=%.2f (%u bytes) \n", DISPLAYLEVEL(3, "compressed using a %u bytes dictionary : Ratio=%.2f (%u bytes) \n",
(unsigned)dictBuffer.size, (unsigned)dictBuffer.size,
(double)totalSrcSlicesSize / cTotalSize, (unsigned)cTotalSize); (double)totalSrcSlicesSize / (double)cTotalSize, (unsigned)cTotalSize);
/* now dstSlices contain the real compressed size of each block, instead of the maximum capacity */ /* now dstSlices contain the real compressed size of each block, instead of the maximum capacity */
shrinkSizes(dstSlices, cSizes); shrinkSizes(dstSlices, cSizes);

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the
@ -49,8 +49,8 @@ libzstd:
-UZSTD_MULTITHREAD \ -UZSTD_MULTITHREAD \
-U_MSC_VER \ -U_MSC_VER \
-U_WIN32 \ -U_WIN32 \
-RZSTDLIB_VISIBILITY= \ -RZSTDLIB_VISIBLE= \
-RZSTDERRORLIB_VISIBILITY= \ -RZSTDERRORLIB_VISIBLE= \
-RZSTD_FALLTHROUGH=fallthrough \ -RZSTD_FALLTHROUGH=fallthrough \
-DZSTD_HAVE_WEAK_SYMBOLS=0 \ -DZSTD_HAVE_WEAK_SYMBOLS=0 \
-DZSTD_TRACE=0 \ -DZSTD_TRACE=0 \

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
/* /*
* Copyright (c) Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause # SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
# ################################################################ # ################################################################
# Copyright (c) Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
/* /*
* Copyright (c) Yann Collet, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
/* /*
* Copyright (c) Yann Collet, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/* /*
* Copyright (c) Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/* /*
* Copyright (c) Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/* /*
* Copyright (c) Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
/* /*
* Copyright (c) Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2016-present, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the
@ -10,11 +10,13 @@
#include "Pzstd.h" #include "Pzstd.h"
#include "SkippableFrame.h" #include "SkippableFrame.h"
#include "utils/FileSystem.h" #include "utils/FileSystem.h"
#include "utils/Portability.h"
#include "utils/Range.h" #include "utils/Range.h"
#include "utils/ScopeGuard.h" #include "utils/ScopeGuard.h"
#include "utils/ThreadPool.h" #include "utils/ThreadPool.h"
#include "utils/WorkQueue.h" #include "utils/WorkQueue.h"
#include <algorithm>
#include <chrono> #include <chrono>
#include <cinttypes> #include <cinttypes>
#include <cstddef> #include <cstddef>
@ -336,6 +338,10 @@ static size_t calculateStep(
const ZSTD_parameters &params) { const ZSTD_parameters &params) {
(void)size; (void)size;
(void)numThreads; (void)numThreads;
// Not validated to work correctly for window logs > 23.
// It will definitely fail if windowLog + 2 is >= 4GB because
// the skippable frame can only store sizes up to 4GB.
assert(params.cParams.windowLog <= 23);
return size_t{1} << (params.cParams.windowLog + 2); return size_t{1} << (params.cParams.windowLog + 2);
} }
@ -587,7 +593,8 @@ std::uint64_t writeFile(
// start writing before compression is done because we need to know the // start writing before compression is done because we need to know the
// compressed size. // compressed size.
// Wait for the compressed size to be available and write skippable frame // Wait for the compressed size to be available and write skippable frame
SkippableFrame frame(out->size()); assert(uint64_t(out->size()) < uint64_t(1) << 32);
SkippableFrame frame(uint32_t(out->size()));
if (!writeData(frame.data(), outputFd)) { if (!writeData(frame.data(), outputFd)) {
errorHolder.setError("Failed to write output"); errorHolder.setError("Failed to write output");
return bytesWritten; return bytesWritten;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the
@ -8,11 +8,13 @@
*/ */
#pragma once #pragma once
#include "utils/Portability.h"
#include "utils/Range.h" #include "utils/Range.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <cerrno> #include <cerrno>
#include <cstdint> #include <cstdint>
#include <limits>
#include <system_error> #include <system_error>
// A small subset of `std::filesystem`. // A small subset of `std::filesystem`.
@ -82,11 +84,11 @@ inline std::uintmax_t file_size(
std::error_code& ec) noexcept { std::error_code& ec) noexcept {
auto stat = status(path, ec); auto stat = status(path, ec);
if (ec) { if (ec) {
return -1; return std::numeric_limits<uintmax_t>::max();
} }
if (!is_regular_file(stat)) { if (!is_regular_file(stat)) {
ec.assign(ENOTSUP, std::generic_category()); ec.assign(ENOTSUP, std::generic_category());
return -1; return std::numeric_limits<uintmax_t>::max();
} }
ec.clear(); ec.clear();
return stat.st_size; return stat.st_size;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -0,0 +1,16 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under both the BSD-style license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
*/
#pragma once
#include <algorithm>
// Required for windows, which defines min/max, but we want the std:: version.
#undef min
#undef max

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the
@ -14,7 +14,9 @@
#pragma once #pragma once
#include "utils/Likely.h" #include "utils/Likely.h"
#include "utils/Portability.h"
#include <algorithm>
#include <cstddef> #include <cstddef>
#include <cstring> #include <cstring>
#include <stdexcept> #include <stdexcept>

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2019-present, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2017-present, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2017-present, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -2,7 +2,7 @@
### Notices ### Notices
Copyright (c) 2017-present Facebook, Inc. Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is granted to copy and distribute this document Permission is granted to copy and distribute this document
for any purpose and without charge, for any purpose and without charge,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017-present, Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) 2018-present, Yann Collet, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
# ################################################################ # ################################################################
# Copyright (c) Yann Collet, Facebook, Inc. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# #
# This source code is licensed under both the BSD-style license (found in the # This source code is licensed under both the BSD-style license (found in the

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. * Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved. * All rights reserved.
* *
* This source code is licensed under both the BSD-style license (found in the * This source code is licensed under both the BSD-style license (found in the

Some files were not shown because too many files have changed in this diff Show More