]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
9 months agorename variable name 4165/head
Yann Collet [Fri, 11 Oct 2024 22:38:12 +0000 (15:38 -0700)] 
rename variable name

findMatch -> matchFound
since it's a test, as opposed to an active search operation.
suggested by @terrelln

9 months agofixed parameter ordering in `dfast`
Yann Collet [Fri, 11 Oct 2024 22:36:15 +0000 (15:36 -0700)] 
fixed parameter ordering in `dfast`

noticed by @terrelln

9 months agominor: better variable naming
Yann Collet [Thu, 10 Oct 2024 23:07:20 +0000 (16:07 -0700)] 
minor: better variable naming

9 months agomake __asm__ a __GNUC__ specific
Yann Collet [Tue, 8 Oct 2024 23:38:35 +0000 (16:38 -0700)] 
make __asm__ a __GNUC__ specific

9 months agostore dummy bytes within ZSTD_match4Found_cmov()
Yann Collet [Tue, 8 Oct 2024 23:02:54 +0000 (16:02 -0700)] 
store dummy bytes within ZSTD_match4Found_cmov()

feels more logical, better contained

9 months agointroduce memory barrier to force test order
Yann Collet [Tue, 8 Oct 2024 22:54:48 +0000 (15:54 -0700)] 
introduce memory barrier to force test order

suggested by @terrelln

9 months agomade search strategy switchable
Yann Collet [Tue, 8 Oct 2024 18:43:07 +0000 (11:43 -0700)] 
made search strategy switchable

between cmov and branch
and use a simple heuristic based on wlog to select between them.

note: performance is not good on clang (yet)

9 months agorefactor search into an inline function
Yann Collet [Tue, 8 Oct 2024 18:10:48 +0000 (11:10 -0700)] 
refactor search into an inline function

for easier swapping with a parameter

9 months agominor refactor zstd_fast
Yann Collet [Mon, 7 Oct 2024 18:22:40 +0000 (11:22 -0700)] 
minor refactor zstd_fast

make hot variables more local

10 months agoOptimize compression by avoiding unpredictable branches 4144/head
Ilya Tokar [Wed, 18 Sep 2024 21:36:37 +0000 (17:36 -0400)] 
Optimize compression by avoiding unpredictable branches

Avoid unpredictable branch. Use conditional move to generate the address
that is guaranteed to be safe and compare unconditionally.
Instead of

if (idx < limit && x[idx] == val ) // mispredicted idx < limit branch

Do

addr = cmov(safe,x+idx)
if (*addr == val && idx < limit) // almost always false so well predicted

Using microbenchmarks from https://github.com/google/fleetbench,
I get about ~10% speed-up:

name                                                                                          old cpu/op   new cpu/op    delta
BM_ZSTD_COMPRESS_Fleet/compression_level:-7/window_log:15                                     1.46ns ± 3%   1.31ns ± 7%   -9.88%  (p=0.000 n=35+38)
BM_ZSTD_COMPRESS_Fleet/compression_level:-7/window_log:16                                     1.41ns ± 3%   1.28ns ± 3%   -9.56%  (p=0.000 n=36+39)
BM_ZSTD_COMPRESS_Fleet/compression_level:-5/window_log:15                                     1.61ns ± 1%   1.43ns ± 3%  -10.70%  (p=0.000 n=30+39)
BM_ZSTD_COMPRESS_Fleet/compression_level:-5/window_log:16                                     1.54ns ± 2%   1.39ns ± 3%   -9.21%  (p=0.000 n=37+39)
BM_ZSTD_COMPRESS_Fleet/compression_level:-3/window_log:15                                     1.82ns ± 2%   1.61ns ± 3%  -11.31%  (p=0.000 n=37+40)
BM_ZSTD_COMPRESS_Fleet/compression_level:-3/window_log:16                                     1.73ns ± 3%   1.56ns ± 3%   -9.50%  (p=0.000 n=38+39)
BM_ZSTD_COMPRESS_Fleet/compression_level:-1/window_log:15                                     2.12ns ± 2%   1.79ns ± 3%  -15.55%  (p=0.000 n=34+39)
BM_ZSTD_COMPRESS_Fleet/compression_level:-1/window_log:16                                     1.99ns ± 3%   1.72ns ± 3%  -13.70%  (p=0.000 n=38+38)
BM_ZSTD_COMPRESS_Fleet/compression_level:0/window_log:15                                      3.22ns ± 3%   2.94ns ± 3%   -8.67%  (p=0.000 n=38+40)
BM_ZSTD_COMPRESS_Fleet/compression_level:0/window_log:16                                      3.19ns ± 4%   2.86ns ± 4%  -10.55%  (p=0.000 n=40+38)
BM_ZSTD_COMPRESS_Fleet/compression_level:1/window_log:15                                      2.60ns ± 3%   2.22ns ± 3%  -14.53%  (p=0.000 n=40+39)
BM_ZSTD_COMPRESS_Fleet/compression_level:1/window_log:16                                      2.46ns ± 3%   2.13ns ± 2%  -13.67%  (p=0.000 n=39+36)
BM_ZSTD_COMPRESS_Fleet/compression_level:2/window_log:15                                      2.69ns ± 3%   2.46ns ± 3%   -8.63%  (p=0.000 n=37+39)
BM_ZSTD_COMPRESS_Fleet/compression_level:2/window_log:16                                      2.63ns ± 3%   2.36ns ± 3%  -10.47%  (p=0.000 n=40+40)
BM_ZSTD_COMPRESS_Fleet/compression_level:3/window_log:15                                      3.20ns ± 2%   2.95ns ± 3%   -7.94%  (p=0.000 n=35+40)
BM_ZSTD_COMPRESS_Fleet/compression_level:3/window_log:16                                      3.20ns ± 4%   2.87ns ± 4%  -10.33%  (p=0.000 n=40+40)

I've also measured the impact on internal workloads and saw similar
~10% improvement in performance, measured by cpu usage/byte of data.

11 months agoMerge pull request #4113 from facebook/fix4110
Yann Collet [Fri, 9 Aug 2024 00:19:08 +0000 (17:19 -0700)] 
Merge pull request #4113 from facebook/fix4110

formatString_u() can display numbers > 100

11 months agoMerge pull request #4109 from facebook/actionsTest
Yann Collet [Thu, 8 Aug 2024 01:17:18 +0000 (18:17 -0700)] 
Merge pull request #4109 from facebook/actionsTest

added android-ndk-build

11 months agofix c90 comment style 4113/head
Yann Collet [Tue, 6 Aug 2024 19:47:30 +0000 (12:47 -0700)] 
fix c90 comment style

11 months agoformatString_u() can display numbers > 100
Yann Collet [Tue, 6 Aug 2024 18:44:37 +0000 (11:44 -0700)] 
formatString_u() can display numbers > 100

fixes #4110

11 months agoMerge pull request #4111 from facebook/dependabot/github_actions/msys2/setup-msys2...
Yann Collet [Mon, 5 Aug 2024 07:39:06 +0000 (00:39 -0700)] 
Merge pull request #4111 from facebook/dependabot/github_actions/msys2/setup-msys2-2.24.1

Bump msys2/setup-msys2 from 2.24.0 to 2.24.1

11 months agoBump msys2/setup-msys2 from 2.24.0 to 2.24.1 4111/head
dependabot[bot] [Mon, 5 Aug 2024 05:17:43 +0000 (05:17 +0000)] 
Bump msys2/setup-msys2 from 2.24.0 to 2.24.1

Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.24.0 to 2.24.1.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/5df0ca6cbf14efcd08f8d5bd5e049a3cc8e07fd2...ddf331adaebd714795f1042345e6ca57bd66cea8)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
12 months agoMerge pull request #4102 from proppy/decodecorpus-ext
Yann Collet [Wed, 31 Jul 2024 08:43:15 +0000 (01:43 -0700)] 
Merge pull request #4102 from proppy/decodecorpus-ext

tests/decodecorpus: add more advanced options

12 months agoadded android-ndk-build 4109/head
Yann Collet [Tue, 30 Jul 2024 18:02:16 +0000 (11:02 -0700)] 
added android-ndk-build

12 months agoMerge pull request #4107 from Adenilson/ndk01
Yann Collet [Tue, 30 Jul 2024 18:34:27 +0000 (11:34 -0700)] 
Merge pull request #4107 from Adenilson/ndk01

[zstd][android] Fix build with NDK r27

12 months ago[zstd][android] Fix build with NDK r27 4107/head
Adenilson Cavalcanti [Mon, 29 Jul 2024 23:37:41 +0000 (16:37 -0700)] 
[zstd][android] Fix build with NDK r27

The NDK cross compiler declares the target as __linux (which is
not technically incorrect), which triggers the enablement of _GNU_SOURCE
in the newly added code that requires the presence of qsort_r() used
in the COVER dictionary code.

Even though the NDK uses llvm/libc, it doesn't declare qsort_r()
in the stdlib.h header.

The build fix is to only activate the _GNU_SOURCE macro if the OS is
*not* Android, as then we will fallback to the C90 compliant code.

This patch should solve the reported issue number #4103.

12 months agoMerge pull request #4094 from RubenKelevra/patchfrom_singlethread_man_update
Yann Collet [Mon, 29 Jul 2024 16:34:55 +0000 (09:34 -0700)] 
Merge pull request #4094 from RubenKelevra/patchfrom_singlethread_man_update

clarify when to use '--single-thread' with '--patch-from'

12 months agoMerge pull request #4106 from facebook/dependabot/github_actions/msys2/setup-msys2...
Yann Collet [Mon, 29 Jul 2024 16:34:17 +0000 (09:34 -0700)] 
Merge pull request #4106 from facebook/dependabot/github_actions/msys2/setup-msys2-2.24.0

Bump msys2/setup-msys2 from 2.23.0 to 2.24.0

12 months agoMerge pull request #4087 from jclab-joseph/fix/genhtml-windows
Yann Collet [Mon, 29 Jul 2024 16:18:27 +0000 (09:18 -0700)] 
Merge pull request #4087 from jclab-joseph/fix/genhtml-windows

gen_html: Fix build error with mingw

12 months agoMerge pull request #4101 from uilianries/readme/conan
Yann Collet [Mon, 29 Jul 2024 16:17:51 +0000 (09:17 -0700)] 
Merge pull request #4101 from uilianries/readme/conan

[docs] Add instruction how to install zstd using Conan

12 months agoMerge pull request #4104 from facebook/dependabot/github_actions/ossf/scorecard-actio...
Yann Collet [Mon, 29 Jul 2024 16:17:11 +0000 (09:17 -0700)] 
Merge pull request #4104 from facebook/dependabot/github_actions/ossf/scorecard-action-2.4.0

Bump ossf/scorecard-action from 2.3.1 to 2.4.0

12 months agoBump msys2/setup-msys2 from 2.23.0 to 2.24.0 4106/head
dependabot[bot] [Mon, 29 Jul 2024 05:34:42 +0000 (05:34 +0000)] 
Bump msys2/setup-msys2 from 2.23.0 to 2.24.0

Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.23.0 to 2.24.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/d0e80f58dffbc64f6a3a1f43527d469b4fc7b6c8...5df0ca6cbf14efcd08f8d5bd5e049a3cc8e07fd2)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
12 months agoBump ossf/scorecard-action from 2.3.1 to 2.4.0 4104/head
dependabot[bot] [Mon, 29 Jul 2024 05:34:32 +0000 (05:34 +0000)] 
Bump ossf/scorecard-action from 2.3.1 to 2.4.0

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/0864cf19026789058feabb7e87baa5f140aac736...62b2cac7ed8198b15735ed49ab1e5cf35480ba46)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
12 months agotests/decodecorpus: add more advanced options 4102/head
Pawel Czarnecki [Fri, 26 Jul 2024 07:47:16 +0000 (09:47 +0200)] 
tests/decodecorpus: add more advanced options

- add option to force a specific block type
- add option to force a specific literal tyle
- add option to generate only frame headers
- add option to skip generating magic numbers

Co-authored-by: Maciej Dudek <mdudek@antmicro.com>
Co-authored-by: Pawel Czarnecki <pczarnecki@antmicro.com>
Co-authored-by: Robert Winkler <rwinkler@antmicro.com>
Co-authored-by: Roman Dobrodii <rdobrodii@antmicro.com>
12 months agoAdd Conan to readme 4101/head
Uilian Ries [Fri, 26 Jul 2024 07:45:06 +0000 (09:45 +0200)] 
Add Conan to readme

Signed-off-by: Uilian Ries <uilianries@gmail.com>
12 months agoMerge pull request #4096 from tpetazzoni/build-fix
Yann Collet [Tue, 16 Jul 2024 21:09:43 +0000 (14:09 -0700)] 
Merge pull request #4096 from tpetazzoni/build-fix

lib/libzstd.mk: fix typo in the definition of LIB_BINDIR

12 months agolib/libzstd.mk: fix typo in the definition of LIB_BINDIR 4096/head
Thomas Petazzoni [Sat, 13 Jul 2024 11:53:53 +0000 (13:53 +0200)] 
lib/libzstd.mk: fix typo in the definition of LIB_BINDIR

Commit f4dbfce79cb2b82fb496fcd2518ecd3315051b7d ("define LIB_SRCDIR
and LIB_BINDIR") significantly reworked the build logic, but in its
introduction of LIB_BINDIR a typo was made.

It was introduced as such:

+LIB_SRCDIR ?= $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
+LIB_BINDIR ?= $(LIBSRC_DIR)

But the definition of LIB_BINDIR has a typo: it should use
$(LIB_SRCDIR) not $(LIBSRC_DIR).

Due to this, $(LIB_BINDIR) is empty, therefore in programs/Makefile,
-L$(LIB_BINDIR) is expanded to just -L, and consequently when trying
to link the "zstd" binary with the libzstd library, it cannot find it:

host/lib/gcc/powerpc64-buildroot-linux-gnu/13.3.0/../../../../powerpc64-buildroot-linux-gnu/bin/ld: cannot find -lzstd: No such file or directory

This commit fixes the build by fixing this typo.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
12 months agoclarify when to use '--single-thread' with '--patch-from' 4094/head
@RubenKelevra [Sun, 7 Jul 2024 17:43:49 +0000 (19:43 +0200)] 
clarify when to use '--single-thread' with '--patch-from'

Using '--single-thread' with '--patch-from' on compression levels above 15 will lead to significantly worse compression ratios.

Corrected the man page not suggest anymore to do this.

12 months agoMerge pull request #4086 from Adenilson/fix01
Yann Collet [Thu, 4 Jul 2024 07:23:55 +0000 (00:23 -0700)] 
Merge pull request #4086 from Adenilson/fix01

[zstd][dict] Ensure that dictionary training functions are fully reen…

13 months agogen_html: Fix build error in windows 4087/head
Joseph Lee [Wed, 3 Jul 2024 03:26:15 +0000 (12:26 +0900)] 
gen_html: Fix build error in windows

13 months ago[zstd][dict] Ensure that dictionary training functions are fully reentrant 4086/head
Adenilson Cavalcanti [Wed, 19 Jun 2024 00:20:35 +0000 (17:20 -0700)] 
[zstd][dict] Ensure that dictionary training functions are fully reentrant

The two main functions used for dictionary training using the COVER
algorithm require initialization of a COVER_ctx_t where a call
to qsort() is performed.

The issue is that the standard C99 qsort() function doesn't offer
a way to pass an extra parameter for the comparison function callback
(e.g. a pointer to a context) and currently zstd relies on a *global*
static variable to hold a pointer to a context needed to perform
the sort operation.

If a zstd library user invokes either ZDICT_trainFromBuffer_cover or
ZDICT_optimizeTrainFromBuffer_cover from multiple threads, the
global context may be overwritten before/during the call/execution to qsort()
in the initialization of the COVER_ctx_t, thus yielding to crashes
and other bad things (Tm) as reported on issue #4045.

Enters qsort_r(): it was designed to address precisely this situation,
to quote from the documention [1]: "the comparison function does not need to
use global variables to pass through arbitrary arguments, and is therefore
reentrant and safe to use in threads."

It is available with small variations for multiple OSes (GNU, BSD[2],
Windows[3]), and the ISO C11 [4] standard features on annex B-21 qsort_s() as
part of the <stdlib.h>. Let's hope that compilers eventually catch up
with it.

For now, we have to handle the small variations in function parameters
for each platform.

The current fix solves the problem by allowing each executing thread
pass its own COVER_ctx_t instance to qsort_r(), removing the use of
a global pointer and allowing the code to be reentrant.

Unfortunately for *BSD, we cannot leverage qsort_r() given that its API
has changed on newer versions of FreeBSD (14.0) and the other BSD variants
(e.g. NetBSD, OpenBSD) don't implement it.

For such cases we provide a fallback that will work only requiring support
for compilers implementing support for C90.

[1] https://man7.org/linux/man-pages/man3/qsort_r.3.html
[2] https://man.freebsd.org/cgi/man.cgi?query=qsort_r
[3] https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/qsort-s?view=msvc-170
[4] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf

13 months agoMerge pull request #4079 from elasota/truncated-huff-state-error
Yann Collet [Sun, 30 Jun 2024 23:17:03 +0000 (16:17 -0700)] 
Merge pull request #4079 from elasota/truncated-huff-state-error

Throw error if Huffman weight initial states are truncated

13 months agoMerge pull request #4068 from DimitriPapadopoulos/codespell
Yann Collet [Sat, 29 Jun 2024 23:04:05 +0000 (16:04 -0700)] 
Merge pull request #4068 from DimitriPapadopoulos/codespell

Fix new typos found by codespell

13 months agoThrow error if Huffman weight initial states are truncated 4079/head
elasota [Thu, 20 Jun 2024 19:19:58 +0000 (15:19 -0400)] 
Throw error if Huffman weight initial states are truncated

13 months agoFix typos not found by codespell 4068/head
Dimitri Papadopoulos [Wed, 19 Jun 2024 19:04:50 +0000 (21:04 +0200)] 
Fix typos not found by codespell

13 months agoFix new typos found by codespell
Dimitri Papadopoulos [Wed, 5 Jun 2024 17:41:43 +0000 (19:41 +0200)] 
Fix new typos found by codespell

13 months agoMerge pull request #4076 from facebook/fix_macos_build
Yann Collet [Wed, 19 Jun 2024 05:16:00 +0000 (22:16 -0700)] 
Merge pull request #4076 from facebook/fix_macos_build

fix macos build

13 months agofix macos build 4076/head
Yann Collet [Wed, 19 Jun 2024 03:21:25 +0000 (20:21 -0700)] 
fix macos build

weird: after replacing the UNAME line with an identical one,
it does work properly now(??).
Possibly a case of hidden special character?

13 months agoExpose size estimation helpers for Linux (#4064)
Elliot Gorokhovsky [Fri, 14 Jun 2024 18:38:48 +0000 (14:38 -0400)] 
Expose size estimation helpers for Linux (#4064)

13 months agoMerge pull request #4073 from facebook/cygwin_install
Yann Collet [Wed, 12 Jun 2024 18:58:54 +0000 (11:58 -0700)] 
Merge pull request #4073 from facebook/cygwin_install

added a cygwin install test to check #4067

13 months agoadded cygwin install test 4073/head
Yann Collet [Wed, 12 Jun 2024 16:51:01 +0000 (09:51 -0700)] 
added cygwin install test

13 months agoMerge pull request #4067 from QBos07/filterfix
Yann Collet [Wed, 12 Jun 2024 17:55:18 +0000 (10:55 -0700)] 
Merge pull request #4067 from QBos07/filterfix

Fix $filter operants and Msys/Cygwin

13 months agoMerge pull request #4065 from embg/freebsd_ci
Yann Collet [Wed, 12 Jun 2024 16:54:25 +0000 (09:54 -0700)] 
Merge pull request #4065 from embg/freebsd_ci

Drop support for FreeBSD 13.2 CI

13 months agoFix $filter and Msys/Cygwin 4067/head
Quentin Boswank [Wed, 5 Jun 2024 16:21:34 +0000 (18:21 +0200)] 
Fix $filter and Msys/Cygwin

- switched the patter and input of $filter into the right places
- added pattern wildcard to MSYS_NT & CYGWIN_NT as they change with windows versions
- correctly identify MSYS2, even in an env like MINGW64

13 months agominor:doc: specify decompression behavior in presence of multiple concatenated frames
Yann Collet [Tue, 4 Jun 2024 01:30:23 +0000 (18:30 -0700)] 
minor:doc: specify decompression behavior in presence of multiple concatenated frames

directly at ZSTD_decompress() level.

13 months agoUnit test for external sequence producer + static CCtx + streaming (#4063)
Elliot Gorokhovsky [Mon, 3 Jun 2024 16:42:27 +0000 (12:42 -0400)] 
Unit test for external sequence producer + static CCtx + streaming (#4063)

13 months agoDrop FreeBSD 13.2 CI 4065/head
Elliot Gorokhovsky [Mon, 3 Jun 2024 15:36:07 +0000 (08:36 -0700)] 
Drop FreeBSD 13.2 CI

14 months agoMerge pull request #4046 from josepho0918/iar
Yann Collet [Wed, 29 May 2024 22:33:19 +0000 (15:33 -0700)] 
Merge pull request #4046 from josepho0918/iar

Improve support for IAR compiler with attributes and intrinsics

14 months agoMerge pull request #4054 from jbajic/fix-missing-newline
Yann Collet [Wed, 29 May 2024 22:32:54 +0000 (15:32 -0700)] 
Merge pull request #4054 from jbajic/fix-missing-newline

[fix] Add newline when file exceeds 128KB

14 months agoRefactor dictionary matchfinder index safety check (#4039)
Federico Maresca [Wed, 29 May 2024 16:35:24 +0000 (18:35 +0200)] 
Refactor dictionary matchfinder index safety check (#4039)

14 months ago[fix] Add newline when file exceeds 128KB 4054/head
Jure Bajic [Sun, 26 May 2024 09:33:39 +0000 (11:33 +0200)] 
[fix] Add newline when file exceeds 128KB

14 months agoMerge pull request #4050 from Adenilson/fix_legacy_nullptr01
Yann Collet [Tue, 21 May 2024 17:30:45 +0000 (10:30 -0700)] 
Merge pull request #4050 from Adenilson/fix_legacy_nullptr01

[fix] Add check on failed allocation in legacy/zstd_v06

14 months ago[fix] Add check on failed allocation in legacy/zstd_v06 4050/head
Adenilson Cavalcanti [Fri, 17 May 2024 20:37:55 +0000 (13:37 -0700)] 
[fix] Add check on failed allocation in legacy/zstd_v06

As reported by Ben Hawkes in #4026, a failure to allocate a zstd context
would lead to a dereference of a NULL pointer due to a missing check
on the returned result of ZSTDv06_createDCtx().

This patch fix the issue by adding a check for valid returned pointer.

14 months agorevert FSE_readNCount_body attribute 4046/head
Joseph Chen [Wed, 15 May 2024 02:47:50 +0000 (10:47 +0800)] 
revert FSE_readNCount_body attribute

14 months agoImprove support for IAR compiler with attributes and intrinsics
Joseph Chen [Tue, 14 May 2024 08:51:10 +0000 (16:51 +0800)] 
Improve support for IAR compiler with attributes and intrinsics

14 months agoMerge pull request #4040 from facebook/dependabot/github_actions/msys2/setup-msys2...
Yann Collet [Mon, 13 May 2024 16:15:07 +0000 (09:15 -0700)] 
Merge pull request #4040 from facebook/dependabot/github_actions/msys2/setup-msys2-2.23.0

Bump msys2/setup-msys2 from 2.22.0 to 2.23.0

14 months agoBump msys2/setup-msys2 from 2.22.0 to 2.23.0 4040/head
dependabot[bot] [Mon, 13 May 2024 05:18:11 +0000 (05:18 +0000)] 
Bump msys2/setup-msys2 from 2.22.0 to 2.23.0

Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.22.0 to 2.23.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/cc11e9188b693c2b100158c3322424c4cc1dadea...d0e80f58dffbc64f6a3a1f43527d469b4fc7b6c8)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
15 months agoIncrease x-compatibility
Richard Barnes [Fri, 26 Apr 2024 21:44:41 +0000 (14:44 -0700)] 
Increase x-compatibility

15 months agoMake zstd.h compatible with -Wzero-as-null-pointer-constant
Richard Barnes [Fri, 26 Apr 2024 20:48:49 +0000 (13:48 -0700)] 
Make zstd.h compatible with -Wzero-as-null-pointer-constant

15 months agoMerge pull request #4029 from facebook/dependabot/github_actions/github/codeql-action...
Felix Handte [Fri, 26 Apr 2024 15:39:39 +0000 (08:39 -0700)] 
Merge pull request #4029 from facebook/dependabot/github_actions/github/codeql-action-3.25.1

Bump github/codeql-action from 3.24.10 to 3.25.1

15 months agoMerge pull request #4031 from facebook/docDStream
Yann Collet [Thu, 25 Apr 2024 21:11:32 +0000 (14:11 -0700)] 
Merge pull request #4031 from facebook/docDStream

update documentation of ZSTD_decompressStream()

15 months agoupdate documentation of ZSTD_decompressStream() 4031/head
Yann Collet [Tue, 23 Apr 2024 16:31:35 +0000 (09:31 -0700)] 
update documentation of ZSTD_decompressStream()

slightly more precise, by recommending to check the return value.
fix #4030

15 months agoBump github/codeql-action from 3.24.10 to 3.25.1 4029/head
dependabot[bot] [Mon, 22 Apr 2024 05:20:46 +0000 (05:20 +0000)] 
Bump github/codeql-action from 3.24.10 to 3.25.1

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.10 to 3.25.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/4355270be187e1b672a7a1c7c7bae5afdc1ab94a...c7f9125735019aa87cfc361530512d50ea439c71)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
15 months agoupdate test name
Yann Collet [Sun, 21 Apr 2024 17:44:50 +0000 (10:44 -0700)] 
update test name

15 months agoMerge pull request #4025 from alexlnkp/dev
Yann Collet [Sun, 21 Apr 2024 17:14:33 +0000 (10:14 -0700)] 
Merge pull request #4025 from alexlnkp/dev

Fixed all memory leaks and almost all undefined behaviour

15 months agoMerge pull request #3931 from bgilbert/pthread
Yann Collet [Sun, 21 Apr 2024 03:25:19 +0000 (20:25 -0700)] 
Merge pull request #3931 from bgilbert/pthread

meson: don't add `-pthread` to static linking flags on Windows

15 months agoMerge pull request #4019 from b7f7/fix_cmake_rc_build
Yann Collet [Tue, 16 Apr 2024 23:06:17 +0000 (16:06 -0700)] 
Merge pull request #4019 from b7f7/fix_cmake_rc_build

fix missing include folder for resource compiler

15 months agoMerge pull request #4020 from Ansuel/install-mt-pc
Yann Collet [Tue, 16 Apr 2024 23:04:23 +0000 (16:04 -0700)] 
Merge pull request #4020 from Ansuel/install-mt-pc

Provide variant pkg-config file for multi-threaded static lib

15 months agoremoved freeing of the ptr 4025/head
Alex Murkoff [Sun, 14 Apr 2024 13:44:12 +0000 (20:44 +0700)] 
removed freeing of the ptr

15 months agoinit out char array with all members as 0 x2
Alex Murkoff [Sun, 14 Apr 2024 10:57:53 +0000 (17:57 +0700)] 
init out char array with all members as 0 x2

15 months agomade initialize out char array with all elements set to 0
Alex Murkoff [Sun, 14 Apr 2024 10:45:53 +0000 (17:45 +0700)] 
made initialize out char array with all elements set to 0
fixed where i made it to init with just the first one being set to 0

15 months agoreverted the addition of free at the gz_init()
Alex Murkoff [Sat, 13 Apr 2024 05:51:20 +0000 (12:51 +0700)] 
reverted the addition of free at the gz_init()

15 months agofixed ISO C incompatibility
Alex Murkoff [Fri, 12 Apr 2024 19:37:13 +0000 (02:37 +0700)] 
fixed ISO C incompatibility
for good this time... probably

15 months agofixed ISO C incompatibility
Alex Murkoff [Fri, 12 Apr 2024 19:35:32 +0000 (02:35 +0700)] 
fixed ISO C incompatibility

15 months agofixed memory leaks and almost all undefined behaviour
Alex Murkoff [Fri, 12 Apr 2024 19:24:14 +0000 (02:24 +0700)] 
fixed memory leaks and almost all undefined behaviour

15 months agoMerge pull request #4022 from facebook/dependabot/github_actions/github/codeql-action...
Felix Handte [Fri, 12 Apr 2024 15:51:02 +0000 (08:51 -0700)] 
Merge pull request #4022 from facebook/dependabot/github_actions/github/codeql-action-3.24.10

Bump github/codeql-action from 3.24.9 to 3.24.10

15 months agomeson: don't add -pthread to static linking flags on Windows 3931/head
Benjamin Gilbert [Thu, 7 Mar 2024 12:40:27 +0000 (21:40 +0900)] 
meson: don't add -pthread to static linking flags on Windows

Meson always returns -pthread in dependency('threads') on non-MSVC
compilers.  On Windows we use Windows threading primitives, so we don't
need this.  Avoid adding -pthread to libzstd's link flags, either as a
Meson subproject or via pkg-config Libs.private, so the application
doesn't inadvertently depend on winpthreads.

Add a Meson MinGW cross-compile CI test that checks for this.  It turns
out that pzstd fails to build in that environment, so have the test
skip building contrib for now.

15 months agoMerge pull request #4021 from pstef/dev
Yann Collet [Tue, 9 Apr 2024 18:02:49 +0000 (11:02 -0700)] 
Merge pull request #4021 from pstef/dev

Fix zlibWrapper build

15 months agoProvide variant pkg-config file for multi-threaded static lib 4020/head
Christian Marangi [Sat, 6 Apr 2024 12:41:54 +0000 (14:41 +0200)] 
Provide variant pkg-config file for multi-threaded static lib

Multi-threaded static library require -pthread to correctly link and works.
The pkg-config we provide tho only works with dynamic multi-threaded library
and won't provide the correct libs and cflags values if lib-mt is used.

To handle this, introduce an env variable MT to permit advanced user to
install and generate a correct pkg-config file for lib-mt or detect if
lib-mt target is called.

With MT env set on calling make install-pc, libzstd.pc.in is a
pkg-config file for a multi-threaded static library.

On calling make lib-mt, a libzstd.pc is generated for a multi-threaded
static library as it's what asked by the user by forcing it.

libzstd.pc is changed to PHONY to force regeneration of it on calling
lib targets or install-pc to handle case where the same directory is
used for mixed compilation.

This was notice while migrating from meson to make build system where
meson generates a correct .pc file while make doesn't.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
15 months agoBump github/codeql-action from 3.24.9 to 3.24.10 4022/head
dependabot[bot] [Mon, 8 Apr 2024 05:47:58 +0000 (05:47 +0000)] 
Bump github/codeql-action from 3.24.9 to 3.24.10

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.9 to 3.24.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/1b1aada464948af03b950897e5eb522f92603cc2...4355270be187e1b672a7a1c7c7bae5afdc1ab94a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
15 months agoFix zlibWrapper build 4021/head
Piotr Paweł Stefaniak [Sun, 7 Apr 2024 11:04:26 +0000 (13:04 +0200)] 
Fix zlibWrapper build

Just after a clone I'm getting this:

~/zstd/zlibWrapper$ cc -c zstd_zlibwrapper.o gz*.c -lz -lzstd -DSTDC
gzwrite.c: In function ‘gz_write’:
gzwrite.c:226:43: error: ‘z_uInt’ undeclared (first use in this
                         function); did you mean ‘uInt’?
  226 |             state.state->strm.avail_in = (z_uInt)n;
      |                                           ^~~~~~
      |                                           uInt
gzwrite.c:226:43: note: each undeclared identifier is reported only
                        once for each function it appears in
gzwrite.c:226:50: error: expected ‘;’ before ‘n’
  226 |             state.state->strm.avail_in = (z_uInt)n;
      |                                                  ^
      |                                                  ;

z_uInt is never used directly, zconf.h redefines uInt to z_uInt under
the condition that Z_PREFIX is set. All examples use uInt, and the type
of avail_in is also uInt.

In this commit I modify the cast to refer to the same type as the type
of lvalue.

Arguably, the real fix here is to handle possible overflows, but that's
beyond the scope of this commit.

15 months agoMerge pull request #3996 from facebook/fix_nodejs_version_warning
Yann Collet [Sat, 6 Apr 2024 06:06:21 +0000 (23:06 -0700)] 
Merge pull request #3996 from facebook/fix_nodejs_version_warning

fix nodejs deprecation warning

15 months agoMerge pull request #4012 from elasota/spec-remove-fse-overflow
Yann Collet [Sat, 6 Apr 2024 06:06:06 +0000 (23:06 -0700)] 
Merge pull request #4012 from elasota/spec-remove-fse-overflow

Remove specification text stating that probability overflow is invalid

15 months agoMerge pull request #4011 from facebook/fix4005
Yann Collet [Sat, 6 Apr 2024 06:05:53 +0000 (23:05 -0700)] 
Merge pull request #4011 from facebook/fix4005

decompression errors always display the full origin filename

15 months agofix missing include folder for resource compiler 4019/head
BadWolf [Fri, 5 Apr 2024 22:05:58 +0000 (00:05 +0200)] 
fix missing include folder for resource compiler

16 months agoRemove text specifying probability overflow as invalid, the variable-size value encod... 4012/head
elasota [Tue, 2 Apr 2024 00:08:42 +0000 (20:08 -0400)] 
Remove text specifying probability overflow as invalid, the variable-size value encoding scheme makes this impossible.

16 months agodecompression errors always display the full origin filename 4011/head
Yann Collet [Mon, 1 Apr 2024 18:12:26 +0000 (11:12 -0700)] 
decompression errors always display the full origin filename

instead of the truncated size-limited version.

16 months agoFix building on windows-x86 if clang already includes
Yuriy Chernyshov [Thu, 28 Mar 2024 10:54:53 +0000 (11:54 +0100)] 
Fix building on windows-x86 if clang already includes

[D101338](https://reviews.llvm.org/D101338) landed in 2021, so clang16 should have it

16 months agoMerge pull request #3994 from sunpoet/dev
Yann Collet [Mon, 1 Apr 2024 06:09:46 +0000 (23:09 -0700)] 
Merge pull request #3994 from sunpoet/dev

Use md5sum rather than gmd5sum for FreeBSD

16 months agoMerge pull request #3997 from facebook/readme_bench_156
Yann Collet [Sun, 31 Mar 2024 20:17:01 +0000 (13:17 -0700)] 
Merge pull request #3997 from facebook/readme_bench_156

updated benchmarks for v1.5.6

16 months agoupdated benchmarks for v1.5.6 3997/head
Yann Collet [Thu, 28 Mar 2024 01:19:31 +0000 (18:19 -0700)] 
updated benchmarks for v1.5.6

16 months agoMerge pull request #3988 from facebook/dependabot/github_actions/github/codeql-action...
Yann Collet [Thu, 28 Mar 2024 01:05:42 +0000 (18:05 -0700)] 
Merge pull request #3988 from facebook/dependabot/github_actions/github/codeql-action-3.24.9

Bump github/codeql-action from 3.24.7 to 3.24.9

16 months agofix nodejs deprecation warning 3996/head
Yann Collet [Wed, 27 Mar 2024 23:10:15 +0000 (16:10 -0700)] 
fix nodejs deprecation warning

by updating msys2 action

16 months agoMerge pull request #3987 from ManuelBlanc/msbuild_vswhere
Yann Collet [Wed, 27 Mar 2024 22:48:40 +0000 (15:48 -0700)] 
Merge pull request #3987 from ManuelBlanc/msbuild_vswhere

Use vswhere to find MSBuild; add VS2022 support

16 months agoUse md5sum rather than gmd5sum for FreeBSD 3994/head
Po-Chuan Hsieh [Wed, 27 Mar 2024 12:53:52 +0000 (20:53 +0800)] 
Use md5sum rather than gmd5sum for FreeBSD

Reference: https://man.freebsd.org/cgi/man.cgi?query=md5sum

16 months ago[fuzz] Turn off -Werror by default
Nick Terrell [Tue, 26 Mar 2024 17:01:19 +0000 (10:01 -0700)] 
[fuzz] Turn off -Werror by default

This was causing OSS-Fuzz errors, due to compiler differences.
* Fix the issue
* Also turn off -Werror so we don't fail fuzzer builds for warnings
* Turn on -Werror in our CI