[libcxx-commits] [libcxx] [libc++] Remove locale::id::__next_id from the ABI (PR #210360)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 20 06:39:56 PDT 2026


================
@@ -562,11 +562,10 @@ void locale::facet::__on_zero_shared() noexcept { delete this; }
 
 // locale::id
 
-constinit int32_t locale::id::__next_id = 0;
-
 long locale::id::__get() {
-  call_once(__flag_, [&] { __id_ = __libcpp_atomic_add(&__next_id, 1); });
-  return __id_ - 1;
+  constinit static atomic<int32_t> next_id = 0;
----------------
ldionne wrote:

Eh, you're right. Let's still get an ack from @efriedma-quic, but this should indeed not cause any additional issues.

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


More information about the libcxx-commits mailing list