[libcxx-commits] [libcxx] [libc++] Fix bug in atomic_ref's calculation of lock_free-ness (PR #99570)

James Y Knight via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 19 07:33:15 PDT 2024


jyknight wrote:

Re the android failure -- this isn't an android-specific issue, it for any x86-32 platform. The issue is that `__GCC_ATOMIC_LLONG_LOCK_FREE == 2`, while `sizeof(long long) == 8` but `alignof(long long) == 4`.

So, then, the test thinks that any 8-byte but 4-byte-aligned value is lock-free. But it's not. The macro is, (misleadingly, considering the name), _not_ promising that operations on `long long*` are lock-free, rather, that operations on _aligned_ `sizeof(long long)` sized objects are.

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


More information about the libcxx-commits mailing list