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
This commit is contained in:
Hans-Peter Nilsson 2018-11-11 22:20:19 +00:00 committed by Hans-Peter Nilsson
parent 6157c37500
commit 63100c5433
3 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,11 @@
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>
Implement P0318R1 unwrap_ref_decay and unwrap_reference

View File

@ -355,7 +355,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
// Use a fake, minimally aligned pointer.
return __atomic_is_lock_free(sizeof(_M_i),
reinterpret_cast<void *>(-__alignof(_M_i)));
reinterpret_cast<void *>(-_S_alignment));
}
bool
@ -363,7 +363,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
// Use a fake, minimally aligned pointer.
return __atomic_is_lock_free(sizeof(_M_i),
reinterpret_cast<void *>(-__alignof(_M_i)));
reinterpret_cast<void *>(-_S_alignment));
}
_GLIBCXX_ALWAYS_INLINE void

View File

@ -222,7 +222,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
// Produce a fake, minimally aligned pointer.
return __atomic_is_lock_free(sizeof(_M_i),
reinterpret_cast<void *>(-__alignof(_M_i)));
reinterpret_cast<void *>(-_S_alignment));
}
bool
@ -230,7 +230,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
// Produce a fake, minimally aligned pointer.
return __atomic_is_lock_free(sizeof(_M_i),
reinterpret_cast<void *>(-__alignof(_M_i)));
reinterpret_cast<void *>(-_S_alignment));
}
#if __cplusplus >= 201703L