Shrink DLL 2% by removing dead code for Windows XP #1397
Merged
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.
Our codebase is haunted by the ghost of Windows XP! 👻 🎃 🦇
P0218R1_filesystem/test.cpphadWINDOWS_XPsections for manual testing; remove them.winapinls.cppdefined Windows XP support machinery powered by large tables, which is now completely unused. Crucially, this wasn't DLL-exported - it was justextern "C", notextern "C" _CRTIMP2. Therefore, we can remove this without affecting the DLL's interface. (In theory, someone could have been static linking against these functions, but that was never documented/supported, I see no such usage in the MSVC repo, and it wouldn't be a "bincompat" issue as we view the term.)This decreases the size of the STL's DLL by over 2%. x86 release
msvcp140_oss.dllshrinks from 419,840 bytes to 410,624 bytes, saving 9,216 bytes. For x64, the DLL shrinks from 564,224 bytes to 550,912 bytes, saving 13,312 bytes. What a delicious treat! 🍫 🍬 🍭Additionally, we can improve the build throughput of
winapinls.cppin certain configurations. We just need to include<yvals_core.h>which defines_STL_WIN32_WINNTand_STL_WIN32_WINNT_VISTA(identical to_WIN32_WINNT_VISTAwhich we were previously testing against). When we're building for ARM/ARM64/OneCore/etc. and the minimum Windows version is at least Vista, we can completely avoid dragging inawint.hppwhich includesWindows.h.Dev11_1086953_call_once_overhaul/test.cpphad commented-out "Machinery to test the XP codepath" for manual testing. See you later, alligator. 🐊Drop comments in
stl/src/filesystem.cppabout Vista versus XP.