<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 25, 2015, at 9:02 PM, Philippe Hausler &lt;<a href="mailto:phausler@apple.com" class="">phausler@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=""><div class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">&gt;<i class=""> On Dec 22, 2015, at 1:08 PM, Joe Groff via swift-dev &lt;<a href="https://lists.swift.org/mailman/listinfo/swift-dev" class="">swift-dev at swift.org</a>&gt; wrote:
</i>&gt;<i class=""> 
</i>&gt;<i class=""> It looks like the corelibs implementation of CoreFoundation references swift_retainCount in order to implement CFGetRetainCount. Is getting the retain count necessary to CF functionality, or can these functions be removed?</i></pre></div><div class=""><br class=""></div>For some reason I was not on this list;<div class="">So in response to your query about CF’s usage of CFGetRetainCount - I think we can safely forbid that function in the swift version since there is no safe way to use it (even CFMachPort is a bit dodgy for it’s usage).</div><div class=""><br class=""></div><div class="">It might take some surgery but I can probably excise that fairly simply.</div></div></div></blockquote></div><br class=""><div class="">That'd be awesome. Thanks Philippe! For CFMachPort's usage, since it's checking for a retainCount of 1, maybe we could use swift_isUniquelyReferenced* instead, which we do need to reliably support for COW.</div><div class=""><br class=""></div><div class="">-Joe</div></body></html>