Intercept C23 free_sized() and free_aligned_sized()#912
Open
swaroski wants to merge 2 commits into
Open
Conversation
Catch FileNotFoundError/PermissionError in validate_target_file and convert ImportError raised by runpy.run_module for the script itself into a MemrayCommandError with a "memray:" prefix, matching the interpreter's behavior. Suppress the success message when the initial import fails. Signed-off-by: Suyog Bhise <bhise.suyog@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #912 +/- ##
==========================================
- Coverage 92.46% 92.30% -0.17%
==========================================
Files 99 99
Lines 11748 11811 +63
Branches 427 429 +2
==========================================
+ Hits 10863 10902 +39
- Misses 885 909 +24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add hooks for the C23 sized deallocators on glibc Linux. Both are recorded as FREE allocations, matching plain free() per the C23 spec. Weak forward declarations let the build succeed on libc < 2.42; runtime addresses are resolved via dl_iterate_phdr, so a wheel built against old glibc still intercepts these calls when deployed against newer glibc. Signed-off-by: Suyog Bhise <bhise.suyog@gmail.com>
c759c8e to
a8dbd27
Compare
Contributor
Author
|
Fixed preprocessor guard for non-glibc platforms (Alpine/musl/macOS). |
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.
Closes: #725
Adds hooks for C23 sized deallocators on glibc Linux. Both record as FREE per spec. Weak forward decls + runtime symbol resolution make manylinux
wheels (built on old glibc) work on newer glibc systems.
Test plan
test_free_sized_extensionpasses on glibc 2.42+, skips on older