<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Unowned pointers aren't dangling in debug builds; they're more like zombie-detection, where you get a deterministic trap if you access them after the original instance is strong-released for the last time. I can't remember if this is enabled in release builds as well; under -Ounchecked they do become unsafe-unretained.</div><div class=""><br class=""></div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 14, 2016, at 10:51, Callionica (Swift) 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="">How do you figure unowned pointers help you detect errors? Dangling pointers give you no guarantees.<br class=""><br class="">On Wednesday, September 14, 2016, Karl Wagner via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div class=""><div class="">Sorry to hijack the thread, but I was working to fix the fact that we can't have optional unowned pointers in swift and Jordan said he didn't think anybody ever asked for it before. It made me worry about the kind of practices swift is encouraging.</div><div class=""><br class=""></div><div class="">The overhead of using weak pointers isn't massive, but it involves locking and updating global tables (<a href="http://stackoverflow.com/questions/23689155/lots-of-overhead-for-weak-property" target="_blank" class="">http://stackoverflow.com/<wbr class="">questions/23689155/lots-of-<wbr class="">overhead-for-weak-property</a>)<span class="">. Unowned pointers don't have this overhead, and can also help you detect errors because they are fail-deadly.</span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">But yeah, I'd like to be able to reference non-owning instance methods.</span></div><div class=""><br class=""><div style="font-family:'Helvetica Neue','Helvetica',Helvetica,Arial,sans-serif;font:'-apple-system-body'" class=""><a href="https://itunes.apple.com/app/apple-store/id922793622?pt=814382&mt=8&ct=how_i_email" target="_blank" class="">This</a> is how I Email now</div></div></div><div class=""><div class=""><br class=""><br class=""><blockquote type="cite" style="margin:1ex 0 0 0;border-left:1px #ccc solid;padding-left:0.5ex" class=""><div class="">On Sep 14, 2016 at 7:45 am, <<a href="javascript:_e(%7B%7D,'cvml','rmann@latencyzero.com');" target="_blank" class="">Rick Mann</a>> wrote:<br class=""><br class=""></div><div class=""><pre class=""><br class="">> On Sep 13, 2016, at 22:34 , Xiaodi Wu via swift-evolution <<a dir="ltr" href="javascript:_e(%7B%7D,'cvml','swift-evolution@swift.org');" target="_blank" class="">swift-evolution@swift.org</a>> wrote:
<br class="">>
<br class="">> It's similar to Linus' argument against using kernel debuggers (<a dir="ltr" href="https://lwn.net/2000/0914/a/lt-debugger.php3" target="_blank" class="">https://lwn.net/2000/0914/a/<wbr class="">lt-debugger.php3</a>). Understanding your code at a level above the source, and being careful, make you a better developer. There are no features in swift which compensate for a lack of understanding about how your code works.
<br class="">
<br class="">Get off my lawn!
<br class="">
<br class="">
<br class="">--
<br class="">Rick Mann
<br class=""><a dir="ltr" href="javascript:_e(%7B%7D,'cvml','rmann@latencyzero.com');" target="_blank" class="">rmann@latencyzero.com</a>
<br class="">
<br class="">
<br class=""></pre></div></blockquote></div></div></div></blockquote>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>