Xmem: honour 32-bit allocation alignment #2527

Open
XratePirate wants to merge 4 commits from upstream-pr/2529 into main
XratePirate commented 2026-11-25 15:21:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by XratePirate on 2026-11-25T15:21:52Z.


Honour the requested layout.align() for ALLOC_32BIT allocations in XMemAllocDefault and add a unit test.

Closes #2183

<!-- greyfinch-sync:Marvisak/VIctory:issue:6607833706 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2529). Originally posted by [XratePirate](https://github.com/XratePirate) on 2026-11-25T15:21:52Z. --- Honour the requested layout.align() for ALLOC_32BIT allocations in XMemAllocDefault and add a unit test. Closes #2183
Marvisak commented 2026-11-25 16:09:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:58:10Z.


Automated triage for the maintainers.

Proposed close: duplicate of #2184. Re-checked at the new head 7a37340. Thank you for the update. The change to XMemAllocDefault in crates/victory-hle/src/modules/xmem.rs is still the same fix as #2184, which is open, merges cleanly, carries the merge-candidate label and also closes #2183: the 32-bit branch passes the attributes' alignment above 64 KiB to MEM_ADDRESS_REQUIREMENTS::Alignment through a private helper split out of XMemVirtualAlloc.

#2184 has the stronger test. It keeps four live blocks per alignment, so a block cannot pass by landing on a coarser boundary by chance, and it checks that they are writable. alloc_default_32bit_honours_alignment here checks one block per alignment.

If this PR covers a case #2184 misses, say which one and the verdict can be revisited.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167474043 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2529#issuecomment-7167474043). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:58:10Z. --- <!-- victory-triage v1 head=7a3734036cb22eabe2c6fe86ac6ec178fd7d8b04 verdict=proposed-close at=2026-11-25T22:38:30Z --> Automated triage for the maintainers. **Proposed close: duplicate of #2184.** Re-checked at the new head `7a37340`. Thank you for the update. The change to `XMemAllocDefault` in `crates/victory-hle/src/modules/xmem.rs` is still the same fix as #2184, which is open, merges cleanly, carries the merge-candidate label and also closes #2183: the 32-bit branch passes the attributes' alignment above 64 KiB to `MEM_ADDRESS_REQUIREMENTS::Alignment` through a private helper split out of `XMemVirtualAlloc`. #2184 has the stronger test. It keeps four live blocks per alignment, so a block cannot pass by landing on a coarser boundary by chance, and it checks that they are writable. `alloc_default_32bit_honours_alignment` here checks one block per alignment. If this PR covers a case #2184 misses, say which one and the verdict can be revisited. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2529:upstream-pr/2529'
git switch 'upstream-pr/2529'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2529'
git switch 'upstream-pr/2529'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2529'
git switch 'upstream-pr/2529'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2529'
git switch 'main'
git merge --squash 'upstream-pr/2529'
git switch 'main'
git merge --ff-only 'upstream-pr/2529'
git switch 'main'
git merge 'upstream-pr/2529'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2527
No description provided.