|
|
|
@ -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: |
|
|
|
|