Internal change

PiperOrigin-RevId: 690798605
pull/19022/head
Protobuf Team Bot 4 weeks ago committed by Copybara-Service
parent 15487415e4
commit 1aff4adfc6
  1. 8
      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:

Loading…
Cancel
Save