<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>mikeash.com pyblog/friday-qa-2017-08-11-swiftunmanaged.html comments</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-08-11-swiftunmanaged.html#comments</link><description>mikeash.com Recent Comments</description><lastBuildDate>Mon, 09 Nov 2026 20:26:14 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>top septic pumping company in tacoma wa - 2022-01-28 02:34:06</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-08-11-swiftunmanaged.html#comments</link><description>top septic pumping company in Tacoma WA&amp;lt;/a&amp;gt; for your septic installation.</description><guid isPermaLink="true">d36f8763b8600cc7f424b87b59866d6f</guid><pubDate>Fri, 28 Jan 2022 02:34:06 GMT</pubDate></item><item><title>Auto Towing Addison - 2021-06-28 05:40:27</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-08-11-swiftunmanaged.html#comments</link><description>Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck with the upcoming articles. </description><guid isPermaLink="true">14dbbf4fe5b91c393d42b439296c336b</guid><pubDate>Mon, 28 Jun 2021 05:40:27 GMT</pubDate></item><item><title>Divya Godayal - 2018-11-03 18:48:12</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-08-11-swiftunmanaged.html#comments</link><description>Hello
&lt;br /&gt;Thanks for your great articles and videos on memory layout of Swift. 
&lt;br /&gt;&amp;lt;br/&amp;gt;
&lt;br /&gt;I have been trying to solve a problem in my app. I get an NSArray from an Objective-C API and need to read it as a Double array in the Swift app.
&lt;br /&gt;&amp;lt;br/&amp;gt;
&lt;br /&gt;&lt;b&gt;NSArray ----&amp;gt; Double array&lt;/b&gt;
&lt;br /&gt;&amp;lt;br/&amp;gt;
&lt;br /&gt;I don't want to typecast the array using 'as [Double]' since this array is huge and thus the process of typecasting is time consuming.
&lt;br /&gt;&amp;lt;br/&amp;gt;
&lt;br /&gt;The array needs to be consumed using Accelerate function calls, so just need to rebind the memory to &amp;lt;Double&amp;gt;. 
&lt;br /&gt;&amp;lt;br/&amp;gt;
&lt;br /&gt;I have tried rebinding the memory to double but the application behaves unexpectedly. What is the right way to go about it in an optimized way? Is it even possible or O(N) is the only way?</description><guid isPermaLink="true">36ba7a896ce54c23356d8d29b56b7180</guid><pubDate>Sat, 03 Nov 2018 18:48:12 GMT</pubDate></item><item><title>Gwendal Roué - 2017-08-19 16:41:14</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-08-11-swiftunmanaged.html#comments</link><description>Hello, may I ask for a development to this article?
&lt;br /&gt;
&lt;br /&gt;Unmanaged is supposed to help optimizing code by avoiding retain/release calls (see &lt;a href="https://github.com/apple/swift/blob/master/docs/OptimizationTips.rst#advice-use-unmanaged-references-to-avoid-reference-counting-overhead"&gt;https://github.com/apple/swift/blob/master/docs/OptimizationTips.rst#advice-use-unmanaged-references-to-avoid-reference-counting-overhead&lt;/a&gt;). However it is not quite totally clear :-) Do you have any advice on how Unmanaged can remove useless and costly retain/release from Instruments benchmarks?
&lt;br /&gt;
&lt;br /&gt;(side note: is hashcash broken on Safari?)</description><guid isPermaLink="true">fe19eed3ac716b98048ea7d50969a791</guid><pubDate>Sat, 19 Aug 2017 16:41:14 GMT</pubDate></item><item><title>Zhao Han - 2017-08-18 23:20:55</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-08-11-swiftunmanaged.html#comments</link><description>"and once which performs no memory management."
&lt;br /&gt;
&lt;br /&gt;typo: once -&amp;gt; one.</description><guid isPermaLink="true">dc7016f7ac6a138df3d26a53bd4bdcf5</guid><pubDate>Fri, 18 Aug 2017 23:20:55 GMT</pubDate></item><item><title>Thomas Tempelmann - 2017-08-12 08:32:33</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-08-11-swiftunmanaged.html#comments</link><description>Similarly, I surely cannot use Swift's Unmanaged with C++ objects either, even though they are "memory managed", too. Same for objects in C allocated with "malloc".</description><guid isPermaLink="true">abc25f8c01494642e053e5487346337d</guid><pubDate>Sat, 12 Aug 2017 08:32:33 GMT</pubDate></item><item><title>Thomas Tempelmann - 2017-08-12 08:29:22</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-08-11-swiftunmanaged.html#comments</link><description>"Interface with C" code suggests to me that Unmanaged is for dealing with C pointers, like when I have a char* or a struct's contents I want to make access in Swift. But Unmanaged is not for that, right? It seems to be it must only be used with pointers that are managed by the ObjC runtime, so wouldn't it be better to say "Unmanaged is for interfacing NSObject based objects"?</description><guid isPermaLink="true">ac1f195eda4de8b05215d4e5ca4bb7b7</guid><pubDate>Sat, 12 Aug 2017 08:29:22 GMT</pubDate></item></channel></rss>
