-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Attempt to clarify the deallocation rules for UMBP. #85101
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
Attempt to clarify the deallocation rules for UMBP. #85101
Conversation
glessard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor quibbles, but there's nothing wrong with the message.
| /// intPointer.deallocate() | ||
| /// | ||
| /// You should only use `deallocate()` to end the lifetime of memory | ||
| /// created with `allocate()`; it is a programming error to use `free` or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call out free() explicitly, or should we say "other deallocation functions", or maybe "deallocation functions from other libraries"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was torn on this. But I feel like free is the primary means of abuse, and anyone who was going to use anything else that they shouldn't will understand that the rules for free apply to them as well.
Co-authored-by: Guillaume Lessard <[email protected]>
|
@swift-ci smoke test |
|
@swift-ci smoke test macOS |
resolves rdar://162944521 --------- Co-authored-by: Guillaume Lessard <[email protected]>
resolves rdar://162944521