[swift-evolution] [Pitch] Move UnsafeMutablePointer.initialize(from:) to UnsafeMutableBufferPointer

Andrew Trick atrick at apple.com
Wed Dec 7 17:32:07 CST 2016


> On Nov 30, 2016, at 4:48 PM, Ben Cohen via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> Hi swift-evolution,
> 
> Below is a draft proposal for a change to facilitate fixing some memory safety issues in the standard library.
> 
> If you’re interested in the implementation, PRs can be found here: [stdlib] [WIP] Eliminate version of Array.append(contentsOf:) that takes a Collection <https://github.com/apple/swift/pull/5521> and here: [stdlib] [WIP] Add UnsafeRawBufferPointer.initialize(as:from:) <https://github.com/apple/swift/pull/5718>
> (they need a bit of performance work before they’re ready to land)
> 
> Introduction
> 
> The version of UnsafeMutablePointer.initialize(from:) that takes a Collection should be deprecated in favour of a new method on UnsafeMutableBufferPointer that takes a Sequence, with a goal of improving memory safety and enabling faster initialization of memory from sequences. Similarly, UnsafeMutableRawPointer.initializeMemory(as:from:) should be deprecated in favour of a new UnsafeMutableRawBufferPointer.initialize(as:from:).
> 
>  <https://github.com/airspeedswift/swift-evolution/blob/b1d05032567e5c7b469f3ccca1bc1a42175a2400/proposals/NNNN-move-unsafe-initialize-from.md#motivation>
+1 on this proposal.

(looks like I had forgotten to reply to the list)

-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161207/2fa82472/attachment.html>


More information about the swift-evolution mailing list