[libcxx-commits] [libcxx] [libc++] Allows any types of size 4 and 8 to use native platform ulock_wait (Proof of Concept) (PR #161086)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Oct 11 12:53:07 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 {};
----------------
huixie90 wrote:

used `has_unique_object_representations` instead

https://github.com/llvm/llvm-project/pull/161086


More information about the libcxx-commits mailing list