Skip to content

Conversation

@StephanTLavavej
Copy link
Member

Our codebase is haunted by the ghost of Windows XP! 👻 🎃 🦇

  • P0218R1_filesystem/test.cpp had WINDOWS_XP sections for manual testing; remove them.

  • winapinls.cpp defined Windows XP support machinery powered by large tables, which is now completely unused. Crucially, this wasn't DLL-exported - it was just extern "C", not extern "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.dll shrinks 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.cpp in certain configurations. We just need to include <yvals_core.h> which defines _STL_WIN32_WINNT and _STL_WIN32_WINNT_VISTA (identical to _WIN32_WINNT_VISTA which 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 in awint.hpp which includes Windows.h.

  • Dev11_1086953_call_once_overhaul/test.cpp had commented-out "Machinery to test the XP codepath" for manual testing. See you later, alligator. 🐊

  • Drop comments in stl/src/filesystem.cpp about Vista versus XP.

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Oct 24, 2020
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner October 24, 2020 03:19
Copy link
Contributor

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So much red! ❤️

@barcharcraz barcharcraz self-assigned this Oct 28, 2020
@CaseyCarter CaseyCarter self-assigned this Nov 3, 2020
@CaseyCarter CaseyCarter merged commit 185654c into microsoft:master Nov 4, 2020
@CaseyCarter
Copy link
Contributor

CaseyCarter commented Nov 4, 2020

🧟‍♀️ Thanks for smacking this Hungry Evil Zombie code in the head. 🧟‍♂️

fengjixuchui added a commit to fengjixuchui/STL that referenced this pull request Nov 4, 2020
Shrink DLL 2% by removing dead code for Windows XP (microsoft#1397)
@StephanTLavavej StephanTLavavej deleted the windows_xp branch November 4, 2020 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants