Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 690798605
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Oct 29, 2024
1 parent 1548741 commit 1aff4ad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/google/protobuf/message_lite.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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:
Expand Down

0 comments on commit 1aff4ad

Please sign in to comment.