<div dir="ltr"><p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><font color="#000000">Hello!</font></p><p style="margin:0px;line-height:normal"><font color="#000000"><font style="font-family:Menlo;font-size:12px">I got some problem with </font><font face="Menlo"><span style="font-size:12px">ContiguousArray&lt;-&gt;C interaction - I can&#39;t get address of array buffer to process in native code.</span></font></font></p><p style="margin:0px;line-height:normal"><font face="Menlo" color="#000000"><span style="font-size:12px">Could somebody help me to get?</span></font></p><p style="margin:0px;line-height:normal"><font face="Menlo" color="#000000"><span style="font-size:12px"><br></span></font></p><p style="margin:0px;line-height:normal"><font color="#000000"><font face="Menlo"><span style="font-size:12px">Actually I also didn&#39;t find init(</span></font><span style="font-family:Menlo;font-size:12px">Array&lt;...&gt;) in UnsafePointer interface.</span></font></p><p style="margin:0px;line-height:normal"><font color="#000000"><font face="Menlo"><span style="font-size:12px">I wonder what initialiser is used when </span></font><span style="font-family:Menlo;font-size:12px">UnsafePointer</span><span style="font-family:Menlo;font-size:12px">&lt;</span><span style="font-family:Menlo;font-size:12px">T</span><span style="font-family:Menlo;font-size:12px">&gt;(Array&lt;T&gt;)? </span></font></p><p style="margin:0px;line-height:normal"><font color="#000000"><span style="font-family:Menlo;font-size:12px"><br></span></font></p><p style="margin:0px;line-height:normal"><font color="#000000"><span style="font-family:Menlo;font-size:12px">Here is sample code:</span></font></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)"><br></span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">class</span> Test {<br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span class="" style="white-space:pre">        </span><span style="color:rgb(187,44,162)">var</span> a = <span style="color:rgb(39,42,216)">0</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo">}</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">var</span> testarr1 : <span style="color:rgb(112,61,170)">Array</span>&lt;<span style="color:rgb(79,129,135)">Test</span>&gt; = [ <span style="color:rgb(79,129,135)">Test</span>(), <span style="color:rgb(79,129,135)">Test</span>() ]</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">var</span> testarr2 : <span style="color:rgb(112,61,170)">ContiguousArray</span>&lt;<span style="color:rgb(79,129,135)">Test</span>&gt; = [ <span style="color:rgb(79,129,135)">Test</span>(), <span style="color:rgb(79,129,135)">Test</span>() ]</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">let</span> arrPtr1 = <span style="color:rgb(112,61,170)">UnsafePointer</span>&lt;<span style="color:rgb(79,129,135)">Test</span>&gt;(<span style="color:rgb(79,129,135)">testarr1</span>)</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">let</span> arrPtr2 = <span style="color:rgb(112,61,170)">UnsafePointer</span>&lt;<span style="color:rgb(79,129,135)">Test</span>&gt;(<span style="color:rgb(79,129,135)">testarr2</span>) &lt;- error &quot;Cannot invoke initialiser...&quot;</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><br></p></div>