Skip to content

[stdlib] Implement SE-147: Move initialize(from:) from Pointer to BufferPointer #760

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 1 commit into from
Jan 7, 2017

Conversation

airspeedswift
Copy link
Member

This is a coordinated change with this PR on the Swift repo.

Since UnsafeMutablePointer.initialize(from:) is memory-unsafe with collections that underreport their count, it is being migrated to be on UnsafeMutableBufferPointer to avoid buffer overruns.

As part of this, Sequence. _copyContents(initializing:) is being altered to take a buffer not a pointer. This is an internal underscore protocol so not user-impacting, but corelibs-foundation does use it and needs to change at the same time.

@airspeedswift
Copy link
Member Author

@parkera @phausler are you OK with making this change? (needs to be done simultaneously on both versions of Data for us to change it in the std lib)

@parkera
Copy link
Contributor

parkera commented Jan 6, 2017

Looks good to me.

@airspeedswift airspeedswift merged commit 507630e into swiftlang:master Jan 7, 2017
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