<html><body><div id="edo-message"><div>>> <span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">1. It points into memory that it does not own. The developer must do something to to manage the memory’s lifetime.</span></div><div><span style="-webkit-text-size-adjust: auto;"><br></span></div><div><span style="-webkit-text-size-adjust: auto;">Isn't that just a pointer? Is it really necessary to say "unsafe" and "pointer"?</span></div><div><span style="-webkit-text-size-adjust: auto;"><br></span></div><div><span style="-webkit-text-size-adjust: auto;">And if we did want to make it explicit, perhaps we say "unowned" instead, to make it clear how it is unsafe. "</span><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">RawBufferPointer</span><span style="-webkit-text-size-adjust: auto; -webkit-tap-highlight-color: transparent;">"/"UnownedRawBufferPointer" sound pretty good to me. You can derive some pretty solid expectations from those names.</span></div><div><div style="font-family: 'Helvetica Neue','Helvetica',Helvetica,Arial,sans-serif;font:'-apple-system-body';"><br></div></div><div style="font-family: 'Helvetica Neue','Helvetica',Helvetica,Arial,sans-serif;font:'-apple-system-body';">Karl</div></div><div id="edo-original"><div><br><br><blockquote type="cite" style="margin:1ex 0 0 0;border-left:1px #ccc solid;padding-left:0.5ex;"><div>On Sep 6, 2016 at 10:59 pm, <<a href="mailto:atrick@apple.com">Andrew Trick</a>> wrote:<br><br></div><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 2, 2016, at 7:36 PM, Karl via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">* Does this proposal fit well with the feel and direction of Swift?<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Yes, but I’m not sure about the “Unsafe” part of “UnsafeBytes” — what is unsafe about getting the byte-representation of a value?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">As I understand it, “Raw” is what we use for “untyped”, so might I suggest “RawBytes"?</span></div></div></blockquote></div><br class=""><div class="">It’s annoying, but a strict requirement in Swift that any “unsafe” operation be marked with the word “Unsafe” either at that point or in some enclosing scope. Unsafe broadly refers to various forms of memory unsafety. Unsafe bytes is actually safe with respect to pointer aliasing but it is unsafe because</div><div class=""><br class=""></div><div class="">1. It points into memory that it does not own. The developer must do something to to manage the memory’s lifetime.</div><div class=""><br class=""></div><div class="">2. It does not perform bounds-checking in release mode.</div><div class=""><br class=""></div><div class="">In both those respects, it’s just like UnsafeBufferPointer.</div><div class=""><br class=""></div><div class="">-Andy</div></div></blockquote></div></div></body></html>