Add support for the new C23 deallocators - #988
Merged
Merged
Conversation
godlygeek
force-pushed
the
c23_deallocators
branch
4 times, most recently
from
August 6, 2026 22:30
717d8cd to
ff4c2c6
Compare
sarahmonod
approved these changes
Aug 6, 2026
godlygeek
force-pushed
the
c23_deallocators
branch
2 times, most recently
from
August 6, 2026 23:30
17fc4e5 to
d3ef6b5
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #988 +/- ##
==========================================
- Coverage 92.43% 92.39% -0.04%
==========================================
Files 101 101
Lines 13160 13199 +39
Branches 474 477 +3
==========================================
+ Hits 12164 12195 +31
- Misses 996 1004 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Record calls to the `free_sized` and `free_aligned_sized` deallocators introduced in C23. Instead of delegating to the original functions, we delegate to the `free` function for both. This is a legal implementation of these new deallocators, and simplifies our implementation since these functions may not always be available. Signed-off-by: Nana Adjei Manu <n.k.a.manu06@gmail.com> Co-authored-by: Matt Wozniski <mwozniski@bloomberg.net>
godlygeek
force-pushed
the
c23_deallocators
branch
from
August 7, 2026 01:42
d3ef6b5 to
4a4ce8b
Compare
Contributor
Author
|
Thanks for the contribution, @naamanu! |
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.
Record calls to the
free_sizedandfree_aligned_sizeddeallocators introduced in C23.Instead of delegating to the original functions, we delegate to the
freefunction for both. This is a legal implementation of these new deallocators, and simplifies our implementation since these functions may not always be available.Closes #725
This is much of the code from #817, but updated to interpose the C23 deallocators even when Memray itself wasn't built with C23, and to test these changes through the
memray._test_utilsextension module instead of adding something to one of the hand written extension modules in our test suite.