[libcxx-commits] [libcxx] [libc++] Inline fast path for`exception_ptr` copy constructor & destructor (PR #165909)

Adrian Vogelsgesang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 5 22:59:19 PST 2025


================
@@ -67,6 +89,17 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _
 class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
   void* __ptr_;
 
+  static void __do_increment_refcount(void* __ptr) _NOEXCEPT;
+  static void __do_decrement_refcount(void* __ptr) _NOEXCEPT;
+  _LIBCPP_HIDE_FROM_ABI static void __increment_refcount(void* __ptr) _NOEXCEPT {
+    if (__ptr)
+      __do_increment_refcount(__ptr);
+  }
+  _LIBCPP_HIDE_FROM_ABI static void __decrement_refcount(void* __ptr) _NOEXCEPT {
+    if (__ptr)
+      __do_decrement_refcount(__ptr);
+  }
----------------
vogelsgesang wrote:

inlined them

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


More information about the libcxx-commits mailing list