]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Avoid use of hardware interference non-constant [PR102377]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 7 Oct 2021 17:28:04 +0000 (18:28 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 7 Oct 2021 17:35:16 +0000 (18:35 +0100)
libstdc++-v3/ChangeLog:

PR libstdc++/102377
* include/bits/atomic_wait.h (__waiter_pool_base:_S_align):
Hardcode to 64 instead of using non-constant constant.

libstdc++-v3/include/bits/atomic_wait.h

index 35c92644146714ff3418891a5d06dc2b23edd7b0..2ac07ccd05e53be47681dfe7dc6fba5ace3b6260 100644 (file)
@@ -190,11 +190,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
     struct __waiter_pool_base
     {
-#ifdef __cpp_lib_hardware_interference_size
-    static constexpr auto _S_align = hardware_destructive_interference_size;
-#else
-    static constexpr auto _S_align = 64;
-#endif
+      // Don't use std::hardware_destructive_interference_size here because we
+      // don't want the layout of library types to depend on compiler options.
+      static constexpr auto _S_align = 64;
 
       alignas(_S_align) __platform_wait_t _M_wait = 0;