Xmem: honour 32-bit allocation alignment #2529

Open
github-bot wants to merge 4 commits from github-bot/gh-2529 into main AGit
Owner

@⁠XratePirate on GitHub · 2026-11-25 15:21 UTC · original
XratePirate:main → main · +37 −4 · 1 files · 4 commits · open

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

Closes #2183

**@⁠XratePirate** on GitHub · 2026-11-25 15:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/2529) `XratePirate:main` → `main` · +37 −4 · 1 files · 4 commits · open Honour the requested layout.align() for ALLOC_32BIT allocations in XMemAllocDefault and add a unit test. Closes #2183
Pass the decoded layout alignment from attributes into VirtualAlloc2 (MEM_ADDRESS_REQUIREMENTS::Alignment) when ALLOC_32BIT is set in XMemAllocDefault, and add a unit test covering 128 kib to 2 MiBf alignments.
xmem: honour 32-bit allocation alignment 

Closes #2183
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:08:21 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:58 UTC · original · edited 2026-11-25 22:28 UTC

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

**@⁠Marvisak** on GitHub · 2026-11-25 15:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/2529#issuecomment-7167474043) · edited 2026-11-25 22:28 UTC <!-- 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 can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2529/head:github-bot/gh-2529'
git switch 'github-bot/gh-2529'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2529'
git switch 'github-bot/gh-2529'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2529'
git switch 'github-bot/gh-2529'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2529'
git switch 'main'
git merge --squash 'github-bot/gh-2529'
git switch 'main'
git merge --ff-only 'github-bot/gh-2529'
git switch 'main'
git merge 'github-bot/gh-2529'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2529
No description provided.