Repository navigation
Conversation
The retail executable imports both from xmem.dll and they were unimplemented (two of its seven unimplemented xmem imports). They have XMemAlloc's and XMemFree's signatures and are the GDK's built-in allocator behind them, so they share the shim's heap and 64-byte alignment; a block from either pair can be freed by the other. The xmem_attributes trace now names the API, so the four are recorded separately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Native Windows check of
I don't have the retail executable, so I haven't run it past these calls. AI-assisted (Claude Code). No game files. |
Contributor
Author
|
Closing as a duplicate. #5253 (maxxgabriel) serves |
1 of 2 tasks
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RT-5 follow-up. Claimed in #6750 (#6750 (comment)). @ItsNotRexed: an exe PR, as you asked.
What and why
The retail
game_scarlett_master.exeimportsxmem.dll!XMemAllocDefaultandxmem.dll!XMemFreeDefault, and both are unimplemented onmain. They are two of its seven unimplementedxmemimports, listed in #6715 and bobczan's run in #6603. An unimplemented import returns 0, so the firstXMemAllocDefaultcall would hand the title a null block.In the GDK these two are the built-in allocator that
XMemAlloc/XMemFreereach when no allocation hooks are set, and a title calls them directly from hooks of its own. Their signatures matchXMemAlloc/XMemFree(void* (SIZE_T, ULONGLONG)andvoid (void*, ULONGLONG), from the GDK's public xmem reference). The shim therefore serves them from the same heap:runtime/shims/xmem.cppXMemAlloc's_aligned_mallocpath: 64-byte alignment, and a size of 0 becomes 1 byte.xmem_attributesstartup-trace event now carries the API's own name, keyed by (API, word). A real run therefore records the attribute words of all four APIs separately. They are still not decoded; the file's ASSUMPTION note about the attribute word applies to these two as well.runtime/test/xmem_test.cpp, newtest_default_family:runtime/README.md: thexmem.dllshim list and thexmem_attributesrow.Not in this PR: the physical-page group (
XMemAllocatePhysicalPages,XMemFreePhysicalPages,XMemMapPhysicalPages,XMemMapPhysicalPagesScatter),XMemIsToolsMemAvailableandd3d12_xs.dll!D3D12ConfigureVirtualMemoryX(D3D-661). Their argument shapes still need a measurement.Depends on: none. #6709 and #6733 edit other hunks of
xmem.cpp, and #6733 also editstest_attribute_trace, which this PR leaves alone.Tested
Draft until this PR's
RuntimeCI (MSVC build,xmem_teston Windows and under Wine) has run; results will be added here. I have no MSVC on this machine.No game data: import names and counts only. AI-assisted (Claude Code).
🤖 Generated with Claude Code