Commit 7bbdd8d1 by Jonathan Wakely Committed by Jonathan Wakely

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
parent ad1f4687
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];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment