[libcxx-commits] [libcxx] [libc++] Allows any types of size 4 and 8 to use native platform ulock_wait (Proof of Concept) (PR #161086)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Oct 3 11:32:54 PDT 2025
================
@@ -19,10 +23,23 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+template <class _Tp, class = void>
+struct __is_atomic_wait_native_type : false_type {};
+
#if defined(__linux__) || (defined(_AIX) && !defined(__64BIT__))
using __cxx_contention_t _LIBCPP_NODEBUG = int32_t;
+
+template <class _Tp>
+struct __is_atomic_wait_native_type<_Tp, __enable_if_t<is_standard_layout<_Tp>::value && sizeof(_Tp) == 4> > : true_type {};
----------------
ldionne wrote:
Maybe what you mean here is just trivially copyable? What properties of the type do you use?
Or do we need `has_unique_object_representations`? If an object has padding bytes in it, we probably don't want to consider them for the purpose of atomic-waiting?
https://github.com/llvm/llvm-project/pull/161086
More information about the libcxx-commits
mailing list