Make PROTOBUF_TSAN_READ/WRITE into functions to reduce the cost of macros in large translation units. Each macro expansion has a relatively larger cost than a function call. PiperOrigin-RevId: 607386966
diff --git a/src/google/protobuf/compiler/java/java_features.pb.cc b/src/google/protobuf/compiler/java/java_features.pb.cc index 8febacc..8c03453 100644 --- a/src/google/protobuf/compiler/java/java_features.pb.cc +++ b/src/google/protobuf/compiler/java/java_features.pb.cc
@@ -228,7 +228,7 @@ PROTOBUF_NOINLINE void JavaFeatures::Clear() { // @@protoc_insertion_point(message_clear_start:pb.JavaFeatures) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ::google::protobuf::internal::TSanWrite(&_impl_); ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits;
diff --git a/src/google/protobuf/compiler/java/java_features.pb.h b/src/google/protobuf/compiler/java/java_features.pb.h index a2c8b71..7639b46 100644 --- a/src/google/protobuf/compiler/java/java_features.pb.h +++ b/src/google/protobuf/compiler/java/java_features.pb.h
@@ -325,7 +325,7 @@ return value; } inline void JavaFeatures::clear_legacy_closed_enum() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.legacy_closed_enum_ = false; _impl_._has_bits_[0] &= ~0x00000001u; } @@ -339,11 +339,11 @@ // @@protoc_insertion_point(field_set:pb.JavaFeatures.legacy_closed_enum) } inline bool JavaFeatures::_internal_legacy_closed_enum() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.legacy_closed_enum_; } inline void JavaFeatures::_internal_set_legacy_closed_enum(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.legacy_closed_enum_ = value; } @@ -353,7 +353,7 @@ return value; } inline void JavaFeatures::clear_utf8_validation() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.utf8_validation_ = 0; _impl_._has_bits_[0] &= ~0x00000002u; } @@ -367,11 +367,11 @@ // @@protoc_insertion_point(field_set:pb.JavaFeatures.utf8_validation) } inline ::pb::JavaFeatures_Utf8Validation JavaFeatures::_internal_utf8_validation() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + ::google::protobuf::internal::TSanRead(&_impl_); return static_cast<::pb::JavaFeatures_Utf8Validation>(_impl_.utf8_validation_); } inline void JavaFeatures::_internal_set_utf8_validation(::pb::JavaFeatures_Utf8Validation value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ::google::protobuf::internal::TSanWrite(&_impl_); assert(::pb::JavaFeatures_Utf8Validation_IsValid(value)); _impl_.utf8_validation_ = value; }