-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
…racterSet wrapper rdar://137806932
@swift-ci test |
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.
Did you know if the boxing was introduced to address some issues, or was that preventive?
Also we probably want this for 6.0.2 as well |
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. |
…racterSet wrapper (swiftlang#5107) rdar://137806932 (cherry picked from commit cb6b2fa)
…racterSet wrapper (swiftlang#5107) rdar://137806932 (cherry picked from commit cb6b2fa)
… up to swiftlang#5107) rdar://138005684
… up to swiftlang#5107) rdar://138005684 (cherry picked from commit 592f015)
… up to swiftlang#5107) rdar://138005684 (cherry picked from commit 592f015)
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