Skip to content
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-3309] Fix pointer deallocate() method inconsistency #45897

Closed
natecook1000 opened this issue Dec 1, 2016 · 2 comments
Closed

[SR-3309] Fix pointer deallocate() method inconsistency #45897

natecook1000 opened this issue Dec 1, 2016 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@natecook1000
Copy link
Member

Previous ID SR-3309
Radar rdar://problem/29470102
Original Reporter @natecook1000
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Standard Library
Labels Bug
Assignee None
Priority Medium

md5: 7c994ee1b772f57d0336f9803e6f2f97

Issue Description:

There's currently an inconsistency between the raw and typed unsafe pointer APIs on what kinds of pointers can be used to deallocate memory. Of the typed pointers, only UnsafeMutablePointer has a deallocate() method, while both raw pointers, UnsafeRawPointer and UnsafeMutableRawPointer, have deallocate(). Adding deallocate() to UnsafePointer is an additive change.

In addition, both raw buffers have deallocate() methods that deallocate all the referenced memory, but neither typed buffer has such a method (although if the typed buffers can deallocate they probably also need to be able to deinitialize...).

@Dante-Broggi
Copy link
Contributor

Is this either done or no longer being considered? If so, it should be closed.

@atrick
Copy link
Member

atrick commented Jul 18, 2018

It looks like the UnsafePointer API cleanup in 4.1 covered this:

https://github.com/apple/swift-evolution/blob/master/proposals/0184-unsafe-pointers-add-missing.md

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants