<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I merged the last of my edits to this proposal (see the PR below), if anyone it interested in seeing where things ended up and doing last minute reviews.</div><div class=""><br class=""></div><div class=""><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md</a></div><div class=""><br class=""></div>-Andy<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 10, 2016, at 6:41 AM, Andrew Trick &lt;<a href="mailto:atrick@apple.com" class="">atrick@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 4, 2016, at 5:32 PM, Andrew Trick via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 28, 2016, at 11:05 PM, Chris Lattner &lt;<a href="mailto:clattner@apple.com" class="">clattner@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hello Swift community,<br class=""><br class="">The review of “SE-0107: UnsafeRawPointer API” begins now and runs through July 4, 2016. The proposal is available here:<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md</a><br class=""></div></div></blockquote></div><div class=""><br class=""></div></div></div></blockquote><br class=""></div><div class=""><div class="">I'm revising this proposal based on last week's feedback. A few of the</div><div class="">additive APIs are removed and a number of UnsafePointer and</div><div class="">UnsafeRawPointer methods are renamed.</div><div class=""><br class=""></div><div class="">Here is a PR for the revision. Note that the examples in the proposal</div><div class="">text still need to be updated:</div><div class=""><a href="https://github.com/apple/swift-evolution/pull/420" class="">https://github.com/apple/swift-evolution/pull/420</a></div><div class=""><br class=""></div><div class="">I updated the short-form summary of the API:</div><div class=""><a href="https://github.com/atrick/swift-evolution/blob/3122ace9d2fb55072ebd7395c7353fcbf497318a/proposals/0107-unsaferawpointer.md#full-unsaferawpointer-api" class="">https://github.com/atrick/swift-evolution/blob/3122ace9d2fb55072ebd7395c7353fcbf497318a/proposals/0107-unsaferawpointer.md#full-unsaferawpointer-api</a></div><div class=""><br class=""></div><div class="">The full UnsafeRawPointer API with doc comments is here:</div><div class=""><a href="https://github.com/atrick/swift/blob/22e3a2885e4236888ec447a7148acf633d8544f5/stdlib/public/core/UnsafeRawPointer.swift.gyb" class="">https://github.com/atrick/swift/blob/22e3a2885e4236888ec447a7148acf633d8544f5/stdlib/public/core/UnsafeRawPointer.swift.gyb</a></div><div class=""><br class=""></div><div class="">The UnsafePointer and UnsafeRawPointer changes are on this branch:</div><div class=""><a href="https://github.com/atrick/swift/commits/rawptr" class="">https://github.com/atrick/swift/commits/rawptr</a></div><div class=""><br class=""></div><div class="">If you wish to comment line-by-line on the detailed docs or</div><div class="">implementation, you can do so here:</div><div class=""><a href="https://github.com/apple/swift/pull/3437" class="">https://github.com/apple/swift/pull/3437</a></div><div class=""><br class=""></div><div class="">---&nbsp;</div><div class="">I should preemptively answer the question "why do UnsafeRawPointer</div><div class="">methods take an explicit type argument when it can be inferred?". Such</div><div class="">as:</div><div class=""><br class=""></div><div class="">&nbsp; rawPtr.initializeMemory(as: Int.self, ...)</div><div class=""><br class=""></div><div class="">These methods don't simply operate on values of some type, they</div><div class="">actively bind memory to that type. At the point of use, that type</div><div class="">needs to be explicit to convey that fact. It's important for</div><div class="">readability, comprehension, and correctness. We cannot rely on type</div><div class="">inferrence on some expression which can change without the original</div><div class="">author's intervention resulting in subtle miscompiles.</div><div class=""><br class=""></div><div class="">---</div><div class="">The only concern I have about this version of the proposal is this method name:&nbsp;</div><div class=""><br class=""></div><div class="">&nbsp; func copyBytes(from: UnsafeRawPointer, count: Int)</div><div class=""><br class=""></div><div class="">because `count` usually refers to a number of values. I think it should be:</div><div class=""><br class=""></div><div class="">&nbsp; func copy(bytes: Int, from: UnsafeRawPointer)</div><div class=""><br class=""></div><div class="">-Andy</div></div><br class=""></div></div></blockquote></div><br class=""></div></body></html>