Skip to content

Use @_borrowed on a few declarations in the stdlib and overlays #20851

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

Conversation

rjmccall
Copy link
Contributor

This is the 5.0 version of #20415.

It is ABI-affecting. I would call it important for convergence because it affects the compilation of basically all code that is generic over collections.

Most of the stdlib's properties don't need @_borrowed because they're
@inlinable, but I did find one place in an overlay where it's probably
sensible to make the operation use generalized accessors even if
they're resilient.
This is a performance hack: inlining a coroutine can promote heap
allocations of the frame to stack allocations, which is valuable
out of proportion to the normal weight.  There are surely more
principled ways of getting this effect, though.
@rjmccall rjmccall requested a review from a team as a code owner November 29, 2018 02:34
@rjmccall
Copy link
Contributor Author

@swift-ci Please test.

Copy link
Contributor

@AnnaZaks AnnaZaks left a comment

Choose a reason for hiding this comment

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

We decided to merge this asap.

@AnnaZaks AnnaZaks merged commit 373e2c8 into swiftlang:swift-5.0-branch Nov 29, 2018
@rjmccall rjmccall deleted the stdlib-borrowed-storage-5.0 branch December 5, 2018 02:57
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