PR libstdc++/71312
* src/c++11/shared_ptr.cc (get_mutex): Align pool mutexes to 64 bytes.
From-SVN: r270649
2019-04-29 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/71312
+ * src/c++11/shared_ptr.cc (get_mutex): Align pool mutexes to 64 bytes.
+
* include/bits/stl_bvector.h (vector<bool>::empty()): Add nodiscard
attribute.
__gnu_cxx::__mutex&
get_mutex(unsigned char i)
{
- static __gnu_cxx::__mutex m[mask + 1];
+ // increase alignment to put each lock on a separate cache line
+ struct alignas(64) M : __gnu_cxx::__mutex { };
+ static M m[mask + 1];
return m[i];
}
}