mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
The review of the ExitProcess note found that platform/win32.c plat_exit_note_modules, which runs on the window thread at every focus loss, was quadratic in the number of modules: GetModuleInformation and GetModuleBaseNameA each walk the loader's module list through ReadProcessMemory. Its probe measured 27.5 ms a note with 292 modules. Each module's size now comes from SizeOfImage in its own image header and its name from GetModuleFileNameA, the part after the last backslash. The header is read through ReadProcessMemory into a 1 KiB buffer rather than in place: a module unloaded since EnumProcessModules then fails the read and is left out, where a plain read would fault. The table's contents are the same. Measured with a probe beside this change (283 modules loaded, scratchpad rv_fxexit_fix\modtime_rpm): 25.3 ms a note before, 0.27 ms after, and both ways note the same 283 bases, sizes and names. tests/exit_tls_check.py, whose note names the program's own module from that table, and the compile check of win32.c pass, with no new -Wall warnings. The review's optional second note after the device is made is left out: vk_device.c create_device is another branch's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>