diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2018-11-11 22:20:19 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2018-11-11 22:20:19 +0000 |
commit | 63100c54335ac179337b6efff89243c75124b1a3 (patch) | |
tree | ab9e784bb5df4f4654a2660d7fc40012ea892d22 | |
parent | 6157c37500dd889e46ded9a8eb357de9a71de0eb (diff) | |
download | gcc-63100c54335ac179337b6efff89243c75124b1a3.zip gcc-63100c54335ac179337b6efff89243c75124b1a3.tar.gz gcc-63100c54335ac179337b6efff89243c75124b1a3.tar.bz2 |
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/atomic_base.h | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/std/atomic | 4 |
3 files changed, 12 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ceaac2d..4742ea4 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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 diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index 7a3354d..57d51bf 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -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 diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic index 0026046..83206dc 100644 --- a/libstdc++-v3/include/std/atomic +++ b/libstdc++-v3/include/std/atomic @@ -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 |