[libcxx-commits] [libcxx] [libcxx][test-support] Implement fancy_pointer_allocator (PR #196187)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 5 02:13:09 PDT 2026


================
@@ -424,6 +434,33 @@ class thread_unsafe_shared_ptr {
     T content;
   };
 
+  thread_unsafe_shared_ptr() = default;
+
+  TEST_CONSTEXPR_CXX20 void detach_control_block() {
+    --block->ref_count;
+    if (block->ref_count != 0)
+      return;
+    typedef std::allocator_traits<std::allocator<control_block> > allocator_traits;
+    std::allocator<control_block> alloc;
+    allocator_traits::destroy(alloc, block);
+#ifdef COUNT_NEW_H
----------------
frederick-vs-ja wrote:

I think this is addressed.

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


More information about the libcxx-commits mailing list