Skip to content

[5.5][runtime] Improve detection of memory allocation failures #38452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 20, 2021

Conversation

glessard
Copy link
Contributor

  • posix_memalign doesn't write to its pointer-to-pointer parameter when it fails, so AlignedAlloc ended up returning stack detritus in that case. The variable is now properly initialized in order to avoid that.

  • update documentation of UMRP.allocate() to specify the requirement for powers-of-2 alignment.

  • update documentation fo UMRBP.allocate() to be as good as UMRP's version.

Resolves rdar://80504684 and rdar://79314903
Cherry-picked from #38424

- `posix_memalign` doesn't write to its pointer-to-pointer parameter when it
  fails, so `AlignedAlloc` ended up returning stack detritus in that case.
  The variable is now properly initialized in order to avoid that.

- update documentation of UMR[B]P.allocate()
@glessard glessard added the r5.5 label Jul 16, 2021
@glessard glessard requested a review from a team as a code owner July 16, 2021 23:21
@glessard glessard self-assigned this Jul 16, 2021
@glessard
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0f0cc93

@glessard
Copy link
Contributor Author

@swift-ci please test macOS platform

@glessard
Copy link
Contributor Author

@swift-ci please test Linux platform

@kylemacomber kylemacomber merged commit 7a6b8d1 into swiftlang:release/5.5 Jul 20, 2021
@glessard glessard deleted the absurd-allocations-5.5 branch July 20, 2021 22:42
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.5 labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants