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 GC_memalign for larger allocations #101

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

jacob-hughes
Copy link
Collaborator

When a layout's alignment is larger than its size, we must allocate using Boehm's memalign function instead of malloc in order to mirror the existing behaviour in rustc.

This is checked in rustc with various assertions on pointer read and write intrinsics, and was discovered when they failed with large alloctions in lrlex using a debug build of alloy.

@ltratt
Copy link
Member

ltratt commented Nov 21, 2023

Can we add a test for this?

@jacob-hughes
Copy link
Collaborator Author

Sure: ba2e09d

@ltratt
Copy link
Member

ltratt commented Nov 21, 2023

Please squash.

When a layout's alignment is larger than its size, we must allocate
using Boehm's `memalign` function instead of `malloc` in order to mirror
the existing behaviour in rustc.

This is checked in rustc with various assertions on pointer read and
write intrinsics, and was discovered when they failed with large
alloctions in lrlex using a debug build of alloy.
@jacob-hughes
Copy link
Collaborator Author

Squashed

@ltratt ltratt added this pull request to the merge queue Nov 21, 2023
Merged via the queue into softdevteam:master with commit ef706e8 Nov 21, 2023
2 checks passed
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