Abandon Windows-internal size optimizations for `mutex` and `condition_variable` (#5030)

This commit is contained in:
Stephan T. Lavavej 2024-10-30 07:28:01 -07:00 коммит произвёл GitHub
Родитель 1990083a8a
Коммит d0a831dfef
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 8 добавлений и 10 удалений

Просмотреть файл

@ -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{};