startup: correct the title-memory leak note on the wrap() failure path #2793
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2801"
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 lambirou on 2026-11-26T10:52:58Z.
Change
The wrap-failure path in
create_committedsays the title's allocator "has no free hook here". That is wrong: the same file documents__XMemAllocationHooks__as{alloc, free, ...}and already uses its alloc entry for every slot 127 title-memory block.The block still leaks on that path. This patch only makes the comment accurate: the free entry exists, but its signature and the attributes it expects have not been verified against the title, and calling it unverified on an out-of-memory path would risk a crash instead of
E_OUTOFMEMORY. The comment now says what is known and what a follow-up must confirm.Refs #2379.
Verification
Comment-only change; no code path is altered. No build or test result is claimed for behavior.
Evidence and follow-up
Follow-up for whoever takes it: confirm the free entry's calling convention and attribute encoding against the title (for example by observing a successful alloc/free pair in a diagnostic run), then call it with the same attributes
title_resource_memorycomputed, and add a source-built fixture that provides a fake__XMemAllocationHooks__table and checks both calls receive the same attributes.AI-assisted.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:57:52Z.
Review: COMMENTED
Review of head
a579ab00(comment-only change).create_committed()insrc/startup_stubs/d3d12_xs_device.cpp(about line 6356). The code (resource->Release(); return E_OUTOFMEMORY;) is unchanged.wrap()failure path and that the free-hook signature is unverified. This is more accurate than the old comment, which only said the allocator had no free hook.git diff --checkclean; GitHub CI "Build and test on Windows" and the Linux Python checks pass.Win2025 WARP receipt (Windows Server 2025, Build 26100, MSVC 14.44.35207) at
a579ab002577aa195fc1ca80fe0c2ae285336f42. This is a comment-only change, so the check is that it still builds:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shimOK, 26.96s--preset release): same targets OK, 48.54sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:58:03Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
a579ab002577aa195fc1ca80fe0c2ae285336f42:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim -- -j 2):26.96s(configure1.92s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim -- -j 2):48.54s(configure2.31s)sccache: 1/7 hits; wall84.3sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:58:35Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
a579ab002577aa195fc1ca80fe0c2ae285336f42:--preset dev):cmake --build --preset dev --target d3d12_xs_shim d3d12_xs_shim_check -- -j 2):1.31s(configure0.00s)ctest --preset dev -R '^d3d12_xs_shim_' --parallel 3 --no-tests=error --output-on-failure): 5/6 passed (0.29s:d3d12_xs_shim_deserialize0.02s,d3d12_xs_shim_exports0.04s,d3d12_xs_shim_serialize0.04s,d3d12_xs_shim_iids0.02s,d3d12_xs_shim_heap_indexing0.02s,d3d12_xs_shim_warp_root0.11s); skipped (capability, not a pass):d3d12_xs_shim_heap_indexing/O2(--preset release):cmake --build --preset release --target d3d12_xs_shim d3d12_xs_shim_check -- -j 2):0.98s(configure0.00s)ctest --preset release -R '^d3d12_xs_shim_' --parallel 3 --no-tests=error --output-on-failure): 5/6 passed (0.30s:d3d12_xs_shim_serialize0.02s,d3d12_xs_shim_exports0.03s,d3d12_xs_shim_deserialize0.02s,d3d12_xs_shim_iids0.02s,d3d12_xs_shim_heap_indexing0.02s,d3d12_xs_shim_warp_root0.11s); skipped (capability, not a pass):d3d12_xs_shim_heap_indexingsccache: 2/2 hits; wall7.0sAI-assisted; commands listed were executed locally.