Skip to content
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

Fix a leak when mutating CharacterSet by moving away from _SwiftNSCharacterSet wrapper #5107

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

parkera
Copy link
Contributor

@parkera parkera commented Oct 14, 2024

CharacterSet was the one remaining type in swift-corelibs-foundation using a wrapper type to handle moving between immutable/mutable and handling uniqueness checks. By removing the wrapper and simplifying the usage, we can also remove the leak from mismanaging an "Unmanaged" CF type reference.

rdar://137806932

@parkera
Copy link
Contributor Author

parkera commented Oct 14, 2024

@swift-ci test

Copy link
Contributor

@itingliu itingliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you know if the boxing was introduced to address some issues, or was that preventive?

@itingliu
Copy link
Contributor

Also we probably want this for 6.0.2 as well

@parkera
Copy link
Contributor Author

parkera commented Oct 15, 2024

Did you know if the boxing was introduced to address some issues, or was that preventive?

It was an abstraction for the several types that used this pattern. But this is the only one left, so it has outlived its usefulness. The Unmanaged part of it was an attempt to avoid accidentally increasing the retain count so copy-on-write worked correctly.

@parkera parkera merged commit cb6b2fa into swiftlang:main Oct 15, 2024
2 of 3 checks passed
parkera added a commit to parkera/swift-corelibs-foundation that referenced this pull request Oct 15, 2024
…racterSet wrapper (swiftlang#5107)

rdar://137806932
(cherry picked from commit cb6b2fa)
parkera added a commit to parkera/swift-corelibs-foundation that referenced this pull request Oct 15, 2024
…racterSet wrapper (swiftlang#5107)

rdar://137806932
(cherry picked from commit cb6b2fa)
parkera added a commit that referenced this pull request Oct 16, 2024
…racterSet wrapper (#5107) (#5110)

rdar://137806932
(cherry picked from commit cb6b2fa)
@parkera parkera deleted the parkera/fix_characterset_leak branch October 21, 2024 15:35
parkera added a commit to parkera/swift-corelibs-foundation that referenced this pull request Oct 22, 2024
parkera added a commit to parkera/swift-corelibs-foundation that referenced this pull request Oct 22, 2024
parkera added a commit to parkera/swift-corelibs-foundation that referenced this pull request Oct 22, 2024
parkera added a commit that referenced this pull request Oct 22, 2024
… up to #5107) (#5121)

rdar://138005684
(cherry picked from commit 592f015)
parkera added a commit that referenced this pull request Oct 22, 2024
parkera added a commit that referenced this pull request Oct 22, 2024
… up to #5107) (#5120)

rdar://138005684
(cherry picked from commit 592f015)
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