Skip to content

fix alignment in readSourceFileToEndAlloc #24518

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gooncreeper
Copy link
Contributor

@gooncreeper gooncreeper commented Jul 20, 2025

Previously, it would return an align(2) slice as provided by toOwnedSliceSentinel, which was problematic as the callee owns the memory and would mistakingly free it as an align(1) slice.

The array list was originally changed to be align(2) to avoid reallocation when converting UTF16LE to UTF8, however this changes it back to align(1) and instead adds a function to std.unicode to convert unaligned codepoints.

@andrewrk
Copy link
Member

hint: make utf16LeToUtf8ArrayList support alignment

Previously, it would return an align(2) slice as provided by
toOwnedSliceSentinel, which was problematic as the callee owns the
memory and would mistakingly free it as an align(1) slice.

The array list was originally changed to be align(2) to avoid
reallocation when converting UTF16LE to UTF8, however this changes it
back to align(1) and instead adds a function to std.unicode to convert
unaligned codepoints.
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