Skip to content

Migrate from UnsafePointer<Void> to UnsafeRawPointer. #478

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

Merged
merged 6 commits into from
Jul 26, 2016

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Jul 26, 2016

Update for SE-0107: UnsafeRawPointer.

Unsafe[Mutable]Pointer is replaced by Unsafe[Mutable]RawPointer.

Migrating often means simply removing casts to/from UnsafePointer
and working directly with UnsafeRawPointer instead.

Unfortunately some API's, like NSData still want UnsafePointer,
which requires "binding" memory to UInt8 before passing it to the API.

Depends on swift PR:
swiftlang/swift#3773

atrick added 6 commits July 26, 2016 13:04
Unsafe[Mutable]Pointer<Void> is replaced by Unsafe[Mutable]RawPointer.

Migrating often means simply removing casts to/from UnsafePointer<UInt8>
and working directly with UnsafeRawPointer instead.

Unfortunately some API's, like NSData still want UnsafePointer<UInt8>,
which requires "binding" memory to UInt8 before passing it to the API.
Remove the generic parameter from NSObject withUnretainedReference.
Raw pointers make it unnecessary and are incompatible with it.
This is a source compatible change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant