[removed by author] #322
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/327"
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 R0Y00/Xbox2Windows. Originally posted by thegl0w on 2026-11-21T22:17:01Z.
[removed by author]
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T03:45:07Z.
state()first allocatesStatewith throwingnew, but the public registry paths arenoexcept. In particular,track()callsstate()before entering itsbad_allochandler. If that first allocation fails while servicing XMemAlloc, the process terminates instead of following the allocation-failure path. Please make first-use initialization safe for these entry points and keep registry/device destruction out of DLL teardown. A focused failure-path check should demonstrate that a failed first track leaves no partial registration and can be retried.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T03:49:58Z.
For this PR, keep the registry private to the module that owns it (option c) and preserve the four XMem exports. The direct-linked fixture can claim attach/lookup behavior within that module. A D3D12 client in another DLL needs a single shared registry and a two-DLL fixture proving it sees allocations from the real xmem provider. Please leave that cross-module ABI for the first such consumer. The outstanding noexcept allocation-failure review still applies.
Imported from R0Y00/Xbox2Windows. Originally posted by thegl0w on 2026-11-22T04:41:59Z.
Thanks, both points are addressed in
21a65e5(docs in348b785).First-use initialization. The state is no longer created with a throwing
new:trackandattachcreate it through a non-throwing step that publishes it with a compare-exchange. If the allocation fails,trackreturnsfalseandattachreturnsE_OUTOFMEMORY. Nothing is registered, and a later call retries.untrack,detach,translate,locate,shader_viewandcountsnever create it. Without it they behave as for an empty registry.std::atomic<State*>, with astatic_assertthat it is trivially destructible, so loading and unloading the module run no code for it and release no D3D12 object.Failure-path check,
era_title_gpu_alloc(no GPU):operator newso that one chosen allocation fails, then fails every allocation of a firsttrack(registry creation included) and of a later one, one at a time.trackreturnedfalse; nothing is tracked, registered withera_queryor translated; and the call is retried.track: 6 failure points. Latertrack: 2.shader_view's empty result allocated under the debug STL inside anoexceptfunction. It now clears the caller's vectors.abort()is reported on stderr rather than through the debug CRT's dialog, and the test has a 30 s timeout.abort()(exit 3). Acountsthat creates the registry, and atrackthat keeps theera_queryregistration after a failed insertion, each fail a check (exit 1).Module boundary: I kept option (c). The registry stays private to the module that links it,
xmem.dllkeeps its four exports, and the header and docs now say so. The cross-module ABI and its two-DLL fixture are left for the first consumer.Run at
21a65e5, Windows 11 build 26300, debug layer enabled:gpu_alias_registry_hardware: 100 of 100 repeated runs on the RTX 3070;gpu_alias_registry_warp: 50 of 50;era_title_gpu_alloc: 50 of 50.The PR description is updated to match.