Open
Description
Previous ID | SR-2468 |
Radar | radar://27987799 |
Original Reporter | slizeray (JIRA User) |
Type | Improvement |
Additional Detail from JIRA
Votes | 0 |
Component/s | Foundation |
Labels | Improvement, SDKOverlay |
Assignee | None |
Priority | Medium |
md5: 350bc083a2e707af5a997f7350836230
Issue Description:
At the moment we must define a custom allocator for the following code:
let retPointer = UnsafeMutableRawPointer.allocate(bytes: size, alignedTo: MemoryLayout<UInt8>.alignment)
let d = Data(bytesNoCopy: retPointer, count: size, deallocator: .custom({ (ptr, size) in
ptr.deallocate(bytes: size, alignedTo: 1)
}))
It would be nice to have a predefined enum for a deallocator that matches UnsafeMutableRawPointer.allocate