Skip to content

[Proposal] Pointer family initialization improvements #1561

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 18 commits into from
Aug 17, 2022

Conversation

glessard
Copy link
Contributor

@glessard glessard commented Mar 1, 2022

Pitch to round out the API for memory initialization through UnsafeMutablePointer and its relatives, as well as adding more capabilities to slices of BufferPointer types.

Pitch thread: https://forums.swift.org/t/55689
Implementation PR: swiftlang/swift#41608

@glessard glessard marked this pull request as ready for review April 19, 2022 18:51
@glessard glessard changed the title proposal for pointer family initialization improvements [Proposal] Pointer family initialization improvements May 20, 2022
@rjmccall
Copy link
Contributor

rjmccall commented Aug 12, 2022

Review manager comments:

  • (removed this point; I missed where you did discuss it in the proposal)
  • I think you should discuss whether the existing element-by-element initialization APIs should be deprecated
  • The document does respond to Jordan's feedback here about the single-element updates, but the argument seems weak. Is this basically an argument for deprecating modifications via pointee / subscript?

@glessard
Copy link
Contributor Author

glessard commented Aug 13, 2022

I think you should discuss whether the existing element-by-element initialization APIs should be deprecated

OK. FWIW I don't think they should be deprecated (it's a fine API for non-Collection Sequences,) but after implementing this, the stdlib can be modified to be stop relying on the fast paths implemented in the many versions of _copyContents; those are where the headaches lie.

the argument seems weak

I agree about the argument, it's not great. I slightly prefer to have updateElement(at:to:), but it may not be worth it. (I'll have to get over my impression that's something's missing when it's not included.)

@rjmccall
Copy link
Contributor

Okay, if you think this is ready, do you have thoughts about scheduling? I can put it into review whenever — if you're okay with it, I'll put it in review from Wednesday through the 29th.

@glessard
Copy link
Contributor Author

That's a good schedule. Thanks!

@rjmccall rjmccall merged commit b338918 into main Aug 17, 2022
@glessard
Copy link
Contributor Author

Thanks @rjmccall !

@glessard glessard deleted the pointer-family-initialization branch August 17, 2022 21:33
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