[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

Kuba (Brecka) Mracek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 10 17:03:23 PST 2017


kubabrecka added inline comments.


================
Comment at: libcxx/include/memory:3702
+inline T
+__libcpp_atomic_increment(T& t) _NOEXCEPT
+{
----------------
I don't think this should be named `__libcpp_atomic_increment`, because it uses relaxed ordering and thus it's not a generic increment (same goes for decrement).  Could we rename this to `__libcpp_atomic_refcount_increment` or something similar?  That would suggest why we're using acq+rel on one side and relaxed on other side.  Using these functions for non-refcount purposes will be wrong and the current names (`__libcpp_atomic_increment`) suggest that they're doing generic atomic operations.


Repository:
  rL LLVM

https://reviews.llvm.org/D24991





More information about the cfe-commits mailing list