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

stdlib: pass along alignment for dealloc #20686

Merged
merged 1 commit into from Nov 21, 2018
Merged

Conversation

compnerd
Copy link
Collaborator

Ensure that UnsafeMutablePointer.deallocate has the alignment that was
used when invoking UnsafeMutablePointer.allocate. This is required to
ensure that the appropriate free function is invoked. We would
previously fail on Windows as the allocation would use malloc and due
to the value being -1, use _aligned_free instead when deallocating.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

Ensure that UnsafeMutablePointer.deallocate has the alignment that was
used when invoking UnsafeMutablePointer.allocate.  This is required to
ensure that the appropriate `free` function is invoked.  We would
previously fail on Windows as the allocation would use `malloc` and due
to the value being `-1`, use `_aligned_free` instead when deallocating.
@compnerd
Copy link
Collaborator Author

@swift-ci please test

@swift-ci
Copy link
Collaborator

Build failed
Swift Test Linux Platform
Git Sha - 381cae6

@compnerd
Copy link
Collaborator Author

@swift-ci please test Linux platform

@compnerd
Copy link
Collaborator Author

CC: @mikeash

@compnerd compnerd merged commit ab37099 into apple:master Nov 21, 2018
@compnerd compnerd deleted the alignment branch November 21, 2018 17:34
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.

None yet

2 participants