[libcxx-commits] [PATCH] D56913: decoupling Freestanding atomic<T> from libatomic.a

Olivier Giroux via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 31 12:18:08 PST 2019


__simt__ marked 2 inline comments as done.
__simt__ added a comment.

In D56913#1379046 <https://reviews.llvm.org/D56913#1379046>, @jfb wrote:

> Should all these macros be in `__config`?


There are 3 macros that I introduced: _LIBCPP_FREESTANDING, _LIBCPP_ATOMIC_FLAG_TYPE, _LIBCPP_ATOMIC_SCOPE_DEFAULT.

They could live in __config, yes.



================
Comment at: libcxx/include/atomic:911
+  _Tp __a_value;
+  mutable _Atomic_s(int, _Sco) __a_lock;
+
----------------
jfb wrote:
> Can we make the lock `uint8_t` or something small for platforms where we have operations for it? Or could it rely on something like wg21.link/p1135r3 and use `atomic_flag`?
It can't be atomic_flag literally, no.

Later in the file I introduce _LIBCPP_ATOMIC_FLAG_TYPE. I could use this here as well.


================
Comment at: libcxx/include/atomic:1265
     _LIBCPP_INLINE_VISIBILITY
-    atomic() _NOEXCEPT _LIBCPP_DEFAULT
+#ifndef _LIBCPP_CXX03_LANG
+    atomic() _NOEXCEPT = default;
----------------
jfb wrote:
> Do we support `atomic` in C++03 mode?
I couldn't get this to build fully successfully without -std=c++11.

Here my change is for consistency, this is what's done on other objects in this file.


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56913/new/

https://reviews.llvm.org/D56913





More information about the libcxx-commits mailing list