11344 Commits

Author SHA1 Message Date
Ryan Lefkowitz
c59812e558 🔧 Fix memory leak in pthread init functions on failure
When pthread_mutex_init() or pthread_cond_init() fails in the debug
implementation (DEBUGLEVEL >= 1), the previously allocated memory was
not freed, causing a memory leak.

This fix ensures that allocated memory is properly freed when pthread
initialization functions fail, preventing resource leaks in error
conditions.

The issue affects:
- ZSTD_pthread_mutex_init() at lib/common/threading.c:146
- ZSTD_pthread_cond_init() at lib/common/threading.c:167

This is particularly important for long-running applications or
scenarios with resource constraints where pthread initialization
might fail due to system limits.
2025-09-15 18:20:01 -04:00
Yann Collet
98d2b90e82
Merge pull request #4480 from facebook/dependabot/github_actions/github/codeql-action-3.30.1
Bump github/codeql-action from 3.29.4 to 3.30.1
2025-09-08 07:52:31 -07:00
Yann Collet
683c91fca8
Merge pull request #4479 from facebook/dependabot/github_actions/msys2/setup-msys2-2.29.0
Bump msys2/setup-msys2 from 2.28.0 to 2.29.0
2025-09-08 07:51:17 -07:00
dependabot[bot]
ef4bab9079
Bump github/codeql-action from 3.29.4 to 3.30.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.4 to 3.30.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4e828ff8d4...f1f6e5f6af)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 05:06:48 +00:00
dependabot[bot]
d3536643a9
Bump msys2/setup-msys2 from 2.28.0 to 2.29.0
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.28.0 to 2.29.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](40677d36a5...fb197b72ce)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 05:06:40 +00:00
Yann Collet
3580aa28e6
Merge pull request #4472 from bgilbert/override_dependency
meson: Call `meson.override_dependency()` if Meson is new enough
2025-09-05 15:32:16 -07:00
Yann Collet
6936bc84e7
Merge pull request #4475 from Cyan4973/default_nbThreads
Default nb threads
2025-09-02 17:19:17 -07:00
Yann Collet
249e4a07d5 fixed minor unused variable warning
in certain compilation modes
2025-09-02 16:36:44 -07:00
Yann Collet
725a152c7b benchmark uses 1 thread by default 2025-09-02 16:29:14 -07:00
Yann Collet
c41fc1aa01 only display nbThread Msg in nbThreads > 1 2025-09-02 16:05:35 -07:00
Yann Collet
6551db3459 specify nb of threads used during benchmarking
used to require `-v` (verbose) modifier
2025-09-02 15:53:45 -07:00
Yann Collet
1c5d45fc11 fixed -T# documentation in zstd -H
provide the local value for default nbThreads
which is dynamic and depends on local nb of cores.
2025-09-02 15:46:51 -07:00
Yann Collet
fc551317fb
Merge pull request #4474 from jlokier/threads-doc-fix
Update manual about the default value of `-T#`/`--threads=#`
2025-09-02 15:40:32 -07:00
Jamie Lokier
64c4288e92 Update manual about the default value of -T#/--threads=#
The section about `ZSTD_NBTHREADS` already explains the default number of
threads, since it changed from 1 (commit 17beeb5).  But the option description
for `-T#`/`--threads=#` incorrectly said the default was still 1.

I noticed this when I found compression slower with `-T1` than without it.
2025-09-02 16:44:39 +01:00
Benjamin Gilbert
ba59aeb674 meson: Call meson.override_dependency() if Meson is new enough
This tells Meson that we intend libzstd_dep to be used by a parent project
if the parent looks for a dependency named "libzstd".  Without this, the
mapping from "libzstd" to our variable libzstd_dep must be encoded in the
Meson wrap file or in the parent's meson.build.
2025-08-28 18:50:34 -05:00
Yann Collet
22b4483163
Merge pull request #4469 from facebook/dependabot/github_actions/actions/setup-java-5.0.0
Bump actions/setup-java from 4.7.1 to 5.0.0
2025-08-25 09:07:01 -07:00
dependabot[bot]
0ee187c540
Bump actions/setup-java from 4.7.1 to 5.0.0
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4.7.1 to 5.0.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](c5195efecf...dded088883)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-25 09:00:57 +00:00
Yann Collet
b5c294ea01
Merge pull request #4440 from arpadpanyik-arm/convert_seq_sve2
AArch64: Add SVE2 path for convertSequences_noRepcodes
2025-08-21 17:20:33 -07:00
Arpad Panyik
2849f3a5d1 AArch64: Add SVE2 path for convertSequences_noRepcodes
Add an 8-way vector length agnostic (VLA) SVE2 code path for
convertSequences_noRepcodes. It works with any SVE vector length.

Relative performance to GCC-13 using: `./fullbench -b18 -l5 enwik5`

               Neon      SVE2
Neoverse-V2   before     after    uplift
GCC-13:      100.000%  103.209%   1.032x
GCC-14:      100.309%  134.872%   1.344x
GCC-15:      100.355%  134.827%   1.343x
Clang-18:    123.614%  128.565%   1.040x
Clang-19:    123.587%  132.984%   1.076x
Clang-20:    123.629%  133.023%   1.075x

               Neon      SVE2
Cortex-A720   before     after    uplift
GCC-13:      100.000%  116.032%   1.160x
GCC-14:       99.700%  116.648%   1.169x
GCC-15:      100.354%  117.047%   1.166x
Clang-18:    100.447%  116.762%   1.162x
Clang-19:    100.454%  116.627%   1.160x
Clang-20:    100.452%  116.649%   1.161x
2025-08-21 17:37:41 +00:00
Yann Collet
290e692ef8
Merge pull request #4463 from brad0/gnu_source_qsort
Check for build environment instead of just _GNU_SOURCE
2025-08-21 09:30:29 -07:00
Yann Collet
b3f134bfd4
Merge pull request #4465 from thiru-mcw/arm64_support
WOA_support:: Add CI setup for packaging Windows on ARM artifacts
2025-08-20 11:23:34 -07:00
Thirumalai Nagalingam
076283fa88 CI: Enable MSVC ARM64 job using Github WOA runner
- Reintroduce the MSVC ARM64 build configuration with "Visual Studio 17 2022"
- Update runner to `windows-11-arm` (GitHub-hosted Windows on ARM)
2025-08-20 17:19:48 +05:30
Thirumalai Nagalingam
002c227596 CI: Add CI setup for packaging Win-ARM64 artifacts 2025-08-20 17:12:21 +05:30
Thirumalai Nagalingam
42243c3d46 CI: Update build_package.bat for CMake builds 2025-08-20 17:12:05 +05:30
Yann Collet
0551eaa851
Merge pull request #4464 from facebook/cli_traces_div0
fixed a potential division by 0 in the cli trace unit
2025-08-19 17:43:11 -07:00
Yann Collet
ae64545c6b fixed a potential division by 0 in the cli trace unit 2025-08-19 17:13:15 -07:00
Brad Smith
0d1f8de9ad Check for build environment instead of just _GNU_SOURCE
Fixes the build on OpenBSD and NetBSD. It is too easy for _GNU_SOURCE
to be defined even on non-Linux systems. Found via py-zstandard with
the embedded copy of zstandard and Python defines _GNU_SOURCE.

Also simplify the Linux checking, there is no need to check the rest
of the symbol names.
2025-08-19 20:06:24 -04:00
Yann Collet
40c285e0ba
Merge pull request #4419 from AZero13/patch-1
Check for job before releasing resources
2025-08-19 17:02:48 -07:00
Yann Collet
cfeb29e397
Merge pull request #4462 from facebook/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-08-18 09:10:13 -07:00
dependabot[bot]
0e69452a30
Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 08:13:07 +00:00
Yann Collet
3991e8ac84
Merge pull request #4459 from Margen67/premake
Remove need for trailing forward slash in dir
2025-08-17 12:14:42 -07:00
Margen67
1e1db47323
Remove need for trailing forward slash in dir 2025-08-17 00:44:39 -07:00
Yann Collet
e128976193
Merge pull request #4448 from Cyan4973/install_oses
regroup list of OSes for install inside common variable
2025-07-28 11:01:58 -08:00
Yann Collet
8bca04ba9f regroup list of OSes for install inside common variable
within lib/install_oses.mk.

fixes #4445
2025-07-28 11:33:22 -07:00
Yann Collet
5b89189741
Merge pull request #4450 from facebook/dependabot/github_actions/github/codeql-action-3.29.4
Bump github/codeql-action from 3.28.9 to 3.29.4
2025-07-28 07:33:09 -08:00
dependabot[bot]
96f316a246
Bump github/codeql-action from 3.28.9 to 3.29.4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.9 to 3.29.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](9e8d0789d4...4e828ff8d4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-28 06:30:43 +00:00
Yann Collet
9bf5d340ae
Merge pull request #4447 from facebook/android-cmake
added android cmake build
2025-07-24 10:07:16 -08:00
Yann Collet
34f3a0ab11
Merge pull request #4413 from arpadpanyik-arm/huf_decode2x
AArch64: Enhance struct access in Huffman decode 2X
2025-07-23 15:03:37 -08:00
Yann Collet
6f1cb87ade
Merge pull request #4443 from facebook/opt_simplify_4442
simplify sequence resolution in zstd_opt
2025-07-23 15:01:36 -08:00
Yann Collet
3b23f0c673 added android cmake build
is expecte to fail, due to #4444
2025-07-23 15:07:20 -07:00
Yann Collet
0055ce7a02 simplify sequence resolution in zstd_opt
initially hinted by @pitaj in #4442
2025-07-18 21:21:47 -07:00
Yann Collet
f9e26bb42b
Merge pull request #4394 from AZero13/zstd
Remove redundant setting of allJobsCompleted to 1
2025-07-18 18:55:47 -08:00
Yann Collet
8c651868ff
Merge pull request #4418 from arpadpanyik-arm/decode_seq_opt
AArch64: Improve ZSTD_decodeSequence performance
2025-07-18 18:54:49 -08:00
Yann Collet
a1e11db08a
Merge pull request #4435 from zijianli1234/dev
add riscv  ci
2025-07-18 18:54:24 -08:00
Yann Collet
afa96bbf25
Merge pull request #4429 from arpadpanyik-arm/convertSequences_Neon
Improve speed of ZSTD_compressSequencesAndLiterals using Neon
2025-07-13 23:52:48 -08:00
Yann Collet
c768d7b94b
Merge pull request #4436 from facebook/dependabot/github_actions/cygwin/cygwin-install-action-6
Bump cygwin/cygwin-install-action from 5 to 6
2025-07-13 23:52:32 -08:00
dependabot[bot]
3ce4d1cba3
Bump cygwin/cygwin-install-action from 5 to 6
Bumps [cygwin/cygwin-install-action](https://github.com/cygwin/cygwin-install-action) from 5 to 6.
- [Release notes](https://github.com/cygwin/cygwin-install-action/releases)
- [Commits](f61179d722...f200932376)

---
updated-dependencies:
- dependency-name: cygwin/cygwin-install-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-14 06:27:46 +00:00
Yann Collet
9a41990883
Merge pull request #4433 from facebook/vs2025
removed VS2019 runners
2025-07-12 19:44:28 -08:00
ZijianLi
534860c90b add -DMEM_FORCE_MEMORY_ACCESS=0 in CI RVV test 2025-07-13 10:51:08 +08:00
Yann Collet
7325384a68 removed VS2019 runners
replaced by one vs2025 runner,
which is badly named since it still running MSVC 2022,
but it's a good test that  shows that the matrix is able to handle multiple MSVC versions.
2025-07-11 10:29:07 -07:00