Skip to content

Change the definition of MALLOC_ALIGN_MASK so it should always be correct on all platforms. #58495

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 28, 2022

Conversation

grynspan
Copy link
Contributor

Change the definition of MALLOC_ALIGN_MASK so it should always be correct on all platforms.

The default path that defines MALLOC_ALIGN_MASK does so incorrectly, producing a power-of-two value instead of a mask. This change resolves the issue by redefining MALLOC_ALIGN_MASK for all platforms in terms of the C/C++ standard max_align_t type (which exists for this purpose.)

Resolves #58486.

@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan grynspan force-pushed the jgrynspan/58486-malloc_align_mask branch from 77e0798 to 40bc80a Compare April 28, 2022 17:22
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan grynspan self-assigned this Apr 28, 2022
@grynspan grynspan merged commit fba7769 into swiftlang:main Apr 28, 2022
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.

MALLOC_ALIGN_MASK is incorrectly defined on some platforms
2 participants