Commit 63100c54 by Hans-Peter Nilsson Committed by Hans-Peter Nilsson

re PR libstdc++/54005 (Use __atomic_always_lock_free in libstdc++ is_lock_free…

re PR libstdc++/54005 (Use __atomic_always_lock_free in libstdc++ is_lock_free instead of __atomic_is_lock_free)

	PR libstdc++-v3/54005
	* include/bits/atomic_base.h (__atomic_base<_TTp>::is_lock_free(),
	__atomic_base<_PTp*>::is_lock_free()): Call __atomic_always_lock_free
	with the type-derived _S_alignment instead of __alignof the object.
	* include/std/atomic (atomic<T>::is_lock_free()): Likewise.

From-SVN: r266018
parent 6157c375
2018-11-11 Hans-Peter Nilsson <hp@axis.com>
PR libstdc++-v3/54005
* include/bits/atomic_base.h (__atomic_base<_TTp>::is_lock_free(),
__atomic_base<_PTp*>::is_lock_free()): Call __atomic_always_lock_free
with the type-derived _S_alignment instead of __alignof the object.
* include/std/atomic (atomic<T>::is_lock_free()): Likewise.
2018-11-11 Jonathan Wakely <jwakely@redhat.com> 2018-11-11 Jonathan Wakely <jwakely@redhat.com>
Implement P0318R1 unwrap_ref_decay and unwrap_reference Implement P0318R1 unwrap_ref_decay and unwrap_reference
......
...@@ -355,7 +355,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -355,7 +355,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
// Use a fake, minimally aligned pointer. // Use a fake, minimally aligned pointer.
return __atomic_is_lock_free(sizeof(_M_i), return __atomic_is_lock_free(sizeof(_M_i),
reinterpret_cast<void *>(-__alignof(_M_i))); reinterpret_cast<void *>(-_S_alignment));
} }
bool bool
...@@ -363,7 +363,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -363,7 +363,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
// Use a fake, minimally aligned pointer. // Use a fake, minimally aligned pointer.
return __atomic_is_lock_free(sizeof(_M_i), return __atomic_is_lock_free(sizeof(_M_i),
reinterpret_cast<void *>(-__alignof(_M_i))); reinterpret_cast<void *>(-_S_alignment));
} }
_GLIBCXX_ALWAYS_INLINE void _GLIBCXX_ALWAYS_INLINE void
......
...@@ -222,7 +222,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -222,7 +222,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
// Produce a fake, minimally aligned pointer. // Produce a fake, minimally aligned pointer.
return __atomic_is_lock_free(sizeof(_M_i), return __atomic_is_lock_free(sizeof(_M_i),
reinterpret_cast<void *>(-__alignof(_M_i))); reinterpret_cast<void *>(-_S_alignment));
} }
bool bool
...@@ -230,7 +230,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -230,7 +230,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
// Produce a fake, minimally aligned pointer. // Produce a fake, minimally aligned pointer.
return __atomic_is_lock_free(sizeof(_M_i), return __atomic_is_lock_free(sizeof(_M_i),
reinterpret_cast<void *>(-__alignof(_M_i))); reinterpret_cast<void *>(-_S_alignment));
} }
#if __cplusplus >= 201703L #if __cplusplus >= 201703L
......
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