Skip to content

CoreFoundation: correct alignment mis-assumption #3164

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 1 commit into from
Apr 1, 2022

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Apr 1, 2022

The allocator on 32-bit platforms are not guaranteed to provide a
16-byte alignment. This would cause an over-aligned request which would
be serviced by a different allocation path which needs to be paired with
an appropriate deallocation invocation. Failure to do so resulted in a
heap corruption on Windows i686.

The allocator on 32-bit platforms are not guaranteed to provide a
16-byte alignment.  This would cause an over-aligned request which would
be serviced by a different allocation path which needs to be paired with
an appropriate deallocation invocation.  Failure to do so resulted in a
heap corruption on Windows i686.
@millenomi
Copy link
Contributor

@swift-ci please test

@millenomi
Copy link
Contributor

Is there a way (even if non-portable?) to get the malloc alignment without having to hardcode it this way?

@millenomi millenomi merged commit 7ff8436 into swiftlang:main Apr 1, 2022
@millenomi
Copy link
Contributor

millenomi commented Apr 1, 2022

For posterity: no, from a cursory search.

@compnerd compnerd deleted the misalignment branch April 2, 2022 01:24
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