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

Use buffer.deallocate() instead of buffer.deallocate(capacity:) in Swift 4.1 or later #259

Merged
merged 2 commits into from
Jul 25, 2018

Conversation

ishkawa
Copy link
Owner

@ishkawa ishkawa commented Jul 25, 2018

UnsafeMutablePointer.deallocate(capacity:) is deprecated in Swift 4.1.

'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead

Since we deallocates entire heap blocks originally, we can just replace deallocate(capacity:) with deallocate() as compiler suggests.

@ishkawa
Copy link
Owner Author

ishkawa commented Jul 25, 2018

Oops, we still need to use deallocate(capacity:) in Swift 4.0.

@ishkawa ishkawa changed the title Use buffer.deallocate() instead of buffer.deallocate(capacity:) Use buffer.deallocate() instead of buffer.deallocate(capacity:) in Swift 4.1 or later Jul 25, 2018
Copy link
Collaborator

@ikesyo ikesyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ishkawa ishkawa merged commit bba530d into master Jul 25, 2018
@ishkawa ishkawa deleted the deallocate-entire-heap-blocks branch July 25, 2018 17:51
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.

2 participants