PR libstdc++/71312 Increase alignment of pooled mutexes
PR libstdc++/71312 * src/c++11/shared_ptr.cc (get_mutex): Align pool mutexes to 64 bytes. From-SVN: r270649
This commit is contained in:
parent
ad1f468736
commit
7bbdd8d13e
@ -1,5 +1,8 @@
|
||||
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.
|
||||
|
||||
|
@ -34,7 +34,9 @@ namespace __gnu_internal _GLIBCXX_VISIBILITY(hidden)
|
||||
__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];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user