Fix compilation error: replace deprecated je_calloc with zcalloc_num#3592
Merged
lucasyonge merged 1 commit intoApr 30, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3592 +/- ##
=========================================
Coverage 76.63% 76.63%
=========================================
Files 160 160
Lines 80472 80472
=========================================
Hits 61668 61668
Misses 18804 18804
🚀 New features to boost your workflow:
|
roshkhatri
approved these changes
Apr 29, 2026
Fixes valkey-io#1905. The direct use of je_calloc in allocator_defrag.c causes compilation failures on systems (e.g., Arch Linux with GCC 14.2.1) where calloc is marked as deprecated with -Werror=deprecated. Replace the two je_calloc calls with zcalloc_num which is the proper Valkey allocation wrapper that handles the calloc semantics (num * size with zero-fill). Signed-off-by: jaduffy <jaduffy@amazon.com>
63a7198 to
e5410e3
Compare
murphyjacob4
approved these changes
Apr 29, 2026
enjoy-binbin
approved these changes
Apr 30, 2026
lucasyonge
pushed a commit
that referenced
this pull request
May 11, 2026
…3592) Fixes #1905 ## Summary The direct use of `je_calloc` in `src/allocator_defrag.c` causes compilation failures on systems (e.g., Arch Linux with GCC 14.2.1) where `calloc` is marked as deprecated and `-Werror=deprecated` is enabled. ## Changes Replace the two `je_calloc` calls in `allocatorDefragInit()` with `zcalloc_num`, which is the proper Valkey allocation wrapper that provides the same semantics (num × size with zero-fill) without directly invoking the deprecated `calloc` symbol. ## Testing - Build compiles cleanly - Integration tests pass (unit/memefficiency, defrag, unit/other — 51 passed, 0 failed) Signed-off-by: jaduffy <jaduffy@amazon.com>
lucasyonge
pushed a commit
that referenced
this pull request
May 12, 2026
…3592) Fixes #1905 ## Summary The direct use of `je_calloc` in `src/allocator_defrag.c` causes compilation failures on systems (e.g., Arch Linux with GCC 14.2.1) where `calloc` is marked as deprecated and `-Werror=deprecated` is enabled. ## Changes Replace the two `je_calloc` calls in `allocatorDefragInit()` with `zcalloc_num`, which is the proper Valkey allocation wrapper that provides the same semantics (num × size with zero-fill) without directly invoking the deprecated `calloc` symbol. ## Testing - Build compiles cleanly - Integration tests pass (unit/memefficiency, defrag, unit/other — 51 passed, 0 failed) Signed-off-by: jaduffy <jaduffy@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1905
Summary
The direct use of
je_callocinsrc/allocator_defrag.ccauses compilation failures on systems (e.g., Arch Linux with GCC 14.2.1) wherecallocis marked as deprecated and-Werror=deprecatedis enabled.Changes
Replace the two
je_calloccalls inallocatorDefragInit()withzcalloc_num, which is the proper Valkey allocation wrapper that provides the same semantics (num × size with zero-fill) without directly invoking the deprecatedcallocsymbol.Testing