> On Apr 27, 2017, at 18:56 , Hooman Mehr <hoo...@mac.com> wrote:
> 
> You should be able to type your `dataBuffer ` as [Int8] (Byte array). Then 
> you won’t need `withUnsafeMutableBytes`. You can simply call it like this:
> 
> self.request = c_library_call(&params, dataBuffer) // Call as if it is a C 
> array

Hmm. I'm not able to pass self.dataBuffer or self.dataBuffer! to the call. It's 
expecting `UnsafeMutableRawPointer!`.

> 
> It works because of C interoperability compiler magic.
> 
> As long as the instance holding `dataBuffer` is not deallocated and you have 
> not resized the array, the pointer should remain valid. 


-- 
Rick Mann
rm...@latencyzero.com


_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to