[swift-evolution] [Pitch] Move UnsafeMutablePointer.initialize(from:) to UnsafeMutableBufferPointer
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)
> 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:).
+1 on this proposal.
(looks like I had forgotten to reply to the list)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution