Skip to content

[Swiftify] Don't create safe wrapper for autoreleasing pointers #81568

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
May 18, 2025

Conversation

hnrklssn
Copy link
Contributor

_SwiftifyImport doesn't know how to handle AutoreleasingUnsafeMutablePointer, so we should not attach any .countedBy information for pointers that are imported as this type.

This also adds defensive checks against adding .countedBy to any pointer type that _SwiftifyImport doesn't know how to transform.

rdar://151479521

_SwiftifyImport doesn't know how to handle
AutoreleasingUnsafeMutablePointer, so we should not attach any
.countedBy information for pointers that are imported as this type.

This also adds defensive checks against adding .countedBy to any pointer
type that _SwiftifyImport doesn't know how to transform.

rdar://151479521
@hnrklssn
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@j-hui j-hui left a comment

Choose a reason for hiding this comment

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

LGTM, aside from a testing suggestion

This test case fails on platforms without Objective-C interop. Move it
to the ObjC directory, and add a local config that disables the entire
subdirectory if Objective-C interop is missing.
@hnrklssn
Copy link
Contributor Author

@swift-ci please smoke test

@hnrklssn
Copy link
Contributor Author

@swift-ci please smoke test linux

1 similar comment
@hnrklssn
Copy link
Contributor Author

@swift-ci please smoke test linux

@hnrklssn hnrklssn merged commit e1eb960 into swiftlang:main May 18, 2025
3 checks passed
hnrklssn added a commit to hnrklssn/swift that referenced this pull request May 18, 2025
…tlang#81568)

_SwiftifyImport doesn't know how to handle
AutoreleasingUnsafeMutablePointer, so we should not attach any
.countedBy information for pointers that are imported as this type.

This also adds defensive checks against adding .countedBy to any pointer
type that _SwiftifyImport doesn't know how to transform.

rdar://151479521
(cherry picked from commit e1eb960)
hnrklssn added a commit that referenced this pull request May 20, 2025
…) (#81590)

_SwiftifyImport doesn't know how to handle
AutoreleasingUnsafeMutablePointer, so we should not attach any
.countedBy information for pointers that are imported as this type.

This also adds defensive checks against adding .countedBy to any pointer
type that _SwiftifyImport doesn't know how to transform.

rdar://151479521
hamishknight added a commit to hamishknight/swift that referenced this pull request May 22, 2025
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