fix(allocator): drop _POSIX_C_SOURCE from posix_memalign branch - #6906
Conversation
Include order (e.g. Python.h) can flip allocation scheme between mat.cpp and inlined Mat::release(), corrupting the heap. Fixes Tencent#6888
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9b26a5895
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Android also defines __unix__; keep API < 17 on memalign. Align fastMalloc/fastFree conditions (drop include-order-sensitive _POSIX_C_SOURCE check). Fixes Tencent#6888
Use the same platform branch as ncnn::fastMalloc/fastFree so host_ptr from prefer_host_memory paths is not freed with the wrong scheme. Fixes Tencent#6888
|
Addressed Codex review:
Also normalized |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6906 +/- ##
==========================================
- Coverage 95.44% 95.41% -0.03%
==========================================
Files 960 960
Lines 459631 459655 +24
==========================================
- Hits 438680 438588 -92
- Misses 20951 21067 +116 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for your contribution ! |
|
Please enable github action in YOUR FORKED REPO to make code-format workflow work |
Makes
fastMalloc/fastFreeuse a consistent posix_memalign/free scheme regardless of whether_POSIX_C_SOURCEwas defined by an earlier include (e.g. Python.h).Fixes #6888