From 1aff4adfc6f523102a3f717c993af5acc701ff17 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Mon, 28 Oct 2024 17:04:34 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 690798605 --- src/google/protobuf/message_lite.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/google/protobuf/message_lite.h b/src/google/protobuf/message_lite.h index 41a7789142..3d43397486 100644 --- a/src/google/protobuf/message_lite.h +++ b/src/google/protobuf/message_lite.h @@ -198,6 +198,10 @@ class PROTOBUF_EXPORT CachedSize { ABSL_DCHECK_NE(desired, 0); __atomic_store_n(&atom_, desired, __ATOMIC_RELAXED); } + + void SetNoDefaultInstance(Scalar desired) const noexcept { + __atomic_store_n(&atom_, desired, __ATOMIC_RELAXED); + } #else CachedSize(const CachedSize& other) noexcept : atom_(other.Get()) {} CachedSize& operator=(const CachedSize& other) noexcept { @@ -222,6 +226,10 @@ class PROTOBUF_EXPORT CachedSize { ABSL_DCHECK_NE(desired, 0); atom_.store(desired, std::memory_order_relaxed); } + + void SetNoDefaultInstance(Scalar desired) const noexcept { + atom_.store(desired, std::memory_order_relaxed); + } #endif private: