New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-3088] UnsafeMutableBufferPointer doesn't have an allocating init #45678
Comments
I'm afraid this would have to go through the Swift Evolution Process, unless I missed some prior discussion. |
We talked about adding this convenience API but didn't get around to it in Swift 3. |
Ah, thanks! (And thanks for linking the discussion.) |
Naturally, adding the `allocate` method implies we should have a `deallocate`. I forgot to mention that in this bug originally. It was an oversight. From Kelvin Ma, swift-evolution, Pitch: Improved Swift pointers:
|
Implemented as part of SE-0184a |
Additional Detail from JIRA
md5: 49bfddea8da991130821d438f3d14f45
Issue Description:
We have:
UnsafeMutablePointer<T>.allocate(...), and
UnsafeMutableRawBufferPointer.allocate(...)
but no UnsafeMutableBufferPointer<T>.allocate(...)
The workaround at the moment is to allocate a UMP and create a UMBP which points to it:
The text was updated successfully, but these errors were encountered: