stephane at lizeray.net
Tue Aug 23 10:40:17 CDT 2016
I create an UsafeMutableRawPointer using the allocate method.
Later on I want to create a Data struct from this pointer using the bytesNoCopy initializer. Which deallocator should I pass?
It looks like this:
let retPointer = UnsafeMutableRawPointer.allocate(bytes: size, alignedTo: MemoryLayout<UInt8>.alignment)
let d = Data(bytesNoCopy: retPointer, count: size,deallocator:Deallocator.free)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users