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

[SR-11583] Reimplement -objectAtIndex: using UnsafePointer to work around refcounting #53988

Open
Catfish-Man opened this issue Oct 7, 2019 · 0 comments
Assignees
Labels
improvement standard library Area: Standard library umbrella

Comments

@Catfish-Man
Copy link
Member

Previous ID SR-11583
Radar None
Original Reporter @Catfish-Man
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement
Assignee @Catfish-Man
Priority Medium

md5: 14c25c2f3ee81bd32feb3d19e6e87e8e

Issue Description:

Currently this generates a retain-autorelease:

  @objc(objectAtIndex:)
  dynamic internal func objectAt(_ index: Int) -> Unmanaged<AnyObject> {
    //TODO: exception instead of precondition, once that's possible
    return Unmanaged.passUnretained(contents[index])
  }

We should have it return an UnsafeRawPointer or something instead. ObjC doesn't care.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

1 participant