Skip to content

Conversation

@stephentyrone
Copy link
Contributor

resolves rdar://162944521

@stephentyrone stephentyrone requested a review from a team as a code owner October 24, 2025 00:17
Copy link
Contributor

@glessard glessard left a 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
Copy link
Contributor

@glessard glessard Oct 24, 2025

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"

Copy link
Contributor Author

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.

@stephentyrone
Copy link
Contributor Author

@swift-ci smoke test

@stephentyrone
Copy link
Contributor Author

@swift-ci smoke test macOS

@stephentyrone stephentyrone merged commit a25f72b into swiftlang:main Oct 24, 2025
3 checks passed
@stephentyrone stephentyrone deleted the clarify-deallocate branch October 24, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants