hle: skip redundant VirtualAlloc commit and VirtualFree placeholder split in xmem::map #1100
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1103"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from fxceless/victory-fork. Originally posted by DoktorTK on 2026-11-25T19:31:19Z.
Avoids two redundant Windows kernel syscalls per remapped page during
CopyPageMappingsBatchX -> xmem::map_alias:VirtualAlloc(..., MEM_COMMIT)(11ae5b5): Tracks committed section pages(Arc::as_ptr(&slice.section), slice.index + k)insidePhysicalsoxmem::maponly commits a backing section page on its first mapping, and cleans up keys whenXMemFreePhysicalPagesfrees pages.VirtualFree(..., MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER)(c95adbb): Tracks exact unsplit placeholders(at, size)returned byUnmapViewOfFile2(..., MEM_PRESERVE_PLACEHOLDER)inunmapsoxmem::mapskips splitting a placeholder that already matchesbase..base + len.Verified with
cargo test --release -p victory-hle(all 99 tests pass).Imported from fxceless/victory-fork. Originally posted by NotADonky43 on 2026-11-25T21:05:01Z.
Related native-Windows test result: on a separate implementation, I remapped 256 destination views between two already-committed source ranges, checking the resulting bytes. On Windows with an RTX 5070 Ti, the D3D12 validation fixture also read the expected texture bytes after remapping. This covered remaps to different backing pages, not identical mappings.
Across four interleaved trials per mode (3,072 backing changes each), a path that removed both the redundant commit and the split for an exact returned placeholder reduced median wall time from 15.43 to 12.23 ms per trial. That number is for both calls combined; it does not isolate the commit cost, validate this PR's bookkeeping, or establish a game FPS gain. Newly mapped or unknown backing still took the commit path in the tested implementation.
[PR #1103] Skip redundant VirtualAlloc MEM_COMMIT on already-committed section p…to [PR #1103] hle: skip redundant VirtualAlloc commit and VirtualFree placeholder split in xmem::mapView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.