From a1f61892d8c57fdf8f3d215d8ac0139ee7a9ee15 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 21 Oct 2024 12:30:14 -0700 Subject: [PATCH] Abandon the Windows-internal size optimizations. --- stl/inc/__msvc_threads_core.hpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/stl/inc/__msvc_threads_core.hpp b/stl/inc/__msvc_threads_core.hpp index 4afe27a5a2a..3bb43713a27 100644 --- a/stl/inc/__msvc_threads_core.hpp +++ b/stl/inc/__msvc_threads_core.hpp @@ -33,13 +33,12 @@ struct _Stl_critical_section { }; struct _Mtx_internal_imp_t { -#if defined(_CRT_WINDOWS) || defined(UNDOCKED_WINDOWS_UCRT) // for Windows-internal code - static constexpr size_t _Critical_section_size = 2 * sizeof(void*); -#elif defined(_WIN64) // ordinary 64-bit code +// TRANSITION, ABI: We should directly store _M_srw_lock above. +#ifdef _WIN64 static constexpr size_t _Critical_section_size = 64; -#else // vvv ordinary 32-bit code vvv +#else // ^^^ 64-bit / 32-bit vvv static constexpr size_t _Critical_section_size = 36; -#endif // ^^^ ordinary 32-bit code ^^^ +#endif // ^^^ 32-bit ^^^ int _Type{}; union { @@ -60,13 +59,12 @@ struct _Stl_condition_variable { #pragma warning(push) #pragma warning(disable : 26495) // Variable 'meow' is uninitialized. Always initialize a member variable (type.6). struct _Cnd_internal_imp_t { -#if defined(_CRT_WINDOWS) // for Windows-internal code - static constexpr size_t _Cnd_internal_imp_size = 2 * sizeof(void*); -#elif defined(_WIN64) // ordinary 64-bit code +// TRANSITION, ABI: We should directly store _Win_cv above. +#ifdef _WIN64 static constexpr size_t _Cnd_internal_imp_size = 72; -#else // vvv ordinary 32-bit code vvv +#else // ^^^ 64-bit / 32-bit vvv static constexpr size_t _Cnd_internal_imp_size = 40; -#endif // ^^^ ordinary 32-bit code ^^^ +#endif // ^^^ 32-bit ^^^ union { _Stl_condition_variable _Stl_cv{};