From b458835fd61740accd3c5cc3ceeaf79b66ea58ff Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Fri, 13 Oct 2023 13:54:09 -0700 Subject: [PATCH] Use GetArena() instead of GetOwningArena() #1 PiperOrigin-RevId: 573311752 --- src/google/protobuf/arena_unittest.cc | 4 +- src/google/protobuf/compiler/cpp/message.cc | 12 +- .../protobuf/compiler/java/java_features.pb.h | 12 +- src/google/protobuf/compiler/plugin.pb.h | 48 +-- src/google/protobuf/cpp_features.pb.h | 12 +- src/google/protobuf/descriptor.pb.h | 384 +++++++++--------- src/google/protobuf/extension_set.cc | 5 +- .../protobuf/generated_message_reflection.cc | 22 +- .../generated_message_tctable_lite.cc | 4 +- 9 files changed, 250 insertions(+), 253 deletions(-) diff --git a/src/google/protobuf/arena_unittest.cc b/src/google/protobuf/arena_unittest.cc index f56ced3229..4a2d502cc1 100644 --- a/src/google/protobuf/arena_unittest.cc +++ b/src/google/protobuf/arena_unittest.cc @@ -723,7 +723,7 @@ TEST(ArenaTest, SetAllocatedAcrossArenasWithReflection) { #if GTEST_HAS_DEATH_TEST EXPECT_DEBUG_DEATH( r->SetAllocatedMessage(arena1_message, arena2_submessage, msg_field), - "GetOwningArena"); + "GetArena"); #endif EXPECT_NE(arena2_submessage, arena1_message->mutable_optional_nested_message()); @@ -736,7 +736,7 @@ TEST(ArenaTest, SetAllocatedAcrossArenasWithReflection) { #if GTEST_HAS_DEATH_TEST EXPECT_DEBUG_DEATH( r->SetAllocatedMessage(heap_message, arena1_submessage, msg_field), - "GetOwningArena"); + "GetArena"); #endif EXPECT_NE(arena1_submessage, heap_message->mutable_optional_nested_message()); delete heap_message; diff --git a/src/google/protobuf/compiler/cpp/message.cc b/src/google/protobuf/compiler/cpp/message.cc index 95ae770824..08fd28f69b 100644 --- a/src/google/protobuf/compiler/cpp/message.cc +++ b/src/google/protobuf/compiler/cpp/message.cc @@ -1297,9 +1297,9 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* p) { "}\n" "inline $classname$& operator=($classname$&& from) noexcept {\n" " if (this == &from) return *this;\n" - " if (GetOwningArena() == from.GetOwningArena()\n" + " if (GetArena() == from.GetArena()\n" "#ifdef PROTOBUF_FORCE_COPY_IN_MOVE\n" - " && GetOwningArena() != nullptr\n" + " && GetArena() != nullptr\n" "#endif // !PROTOBUF_FORCE_COPY_IN_MOVE\n" " ) {\n" " InternalSwap(&from);\n" @@ -1459,10 +1459,10 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* p) { "inline void Swap($classname$* other) {\n" " if (other == this) return;\n" "#ifdef PROTOBUF_FORCE_COPY_IN_SWAP\n" - " if (GetOwningArena() != nullptr &&\n" - " GetOwningArena() == other->GetOwningArena()) {\n " + " if (GetArena() != nullptr &&\n" + " GetArena() == other->GetArena()) {\n " "#else // PROTOBUF_FORCE_COPY_IN_SWAP\n" - " if (GetOwningArena() == other->GetOwningArena()) {\n" + " if (GetArena() == other->GetArena()) {\n" "#endif // !PROTOBUF_FORCE_COPY_IN_SWAP\n" " InternalSwap(other);\n" " } else {\n" @@ -1471,7 +1471,7 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* p) { "}\n" "void UnsafeArenaSwap($classname$* other) {\n" " if (other == this) return;\n" - " $DCHK$(GetOwningArena() == other->GetOwningArena());\n" + " $DCHK$(GetArena() == other->GetArena());\n" " InternalSwap(other);\n" "}\n"); diff --git a/src/google/protobuf/compiler/java/java_features.pb.h b/src/google/protobuf/compiler/java/java_features.pb.h index a3e62b9b1d..048b5778fa 100644 --- a/src/google/protobuf/compiler/java/java_features.pb.h +++ b/src/google/protobuf/compiler/java/java_features.pb.h @@ -125,9 +125,9 @@ class PROTOC_EXPORT JavaFeatures final : } inline JavaFeatures& operator=(JavaFeatures&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -171,10 +171,10 @@ class PROTOC_EXPORT JavaFeatures final : inline void Swap(JavaFeatures* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -183,7 +183,7 @@ class PROTOC_EXPORT JavaFeatures final : } void UnsafeArenaSwap(JavaFeatures* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index 6cf992148b..d8e0f5be41 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -142,9 +142,9 @@ class PROTOC_EXPORT Version final : } inline Version& operator=(Version&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -188,10 +188,10 @@ class PROTOC_EXPORT Version final : inline void Swap(Version* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -200,7 +200,7 @@ class PROTOC_EXPORT Version final : } void UnsafeArenaSwap(Version* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -364,9 +364,9 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : } inline CodeGeneratorResponse_File& operator=(CodeGeneratorResponse_File&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -410,10 +410,10 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : inline void Swap(CodeGeneratorResponse_File* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -422,7 +422,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : } void UnsafeArenaSwap(CodeGeneratorResponse_File* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -602,9 +602,9 @@ class PROTOC_EXPORT CodeGeneratorResponse final : } inline CodeGeneratorResponse& operator=(CodeGeneratorResponse&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -648,10 +648,10 @@ class PROTOC_EXPORT CodeGeneratorResponse final : inline void Swap(CodeGeneratorResponse* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -660,7 +660,7 @@ class PROTOC_EXPORT CodeGeneratorResponse final : } void UnsafeArenaSwap(CodeGeneratorResponse* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -841,9 +841,9 @@ class PROTOC_EXPORT CodeGeneratorRequest final : } inline CodeGeneratorRequest& operator=(CodeGeneratorRequest&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -887,10 +887,10 @@ class PROTOC_EXPORT CodeGeneratorRequest final : inline void Swap(CodeGeneratorRequest* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -899,7 +899,7 @@ class PROTOC_EXPORT CodeGeneratorRequest final : } void UnsafeArenaSwap(CodeGeneratorRequest* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } diff --git a/src/google/protobuf/cpp_features.pb.h b/src/google/protobuf/cpp_features.pb.h index 55e7a01659..8169b4fb86 100644 --- a/src/google/protobuf/cpp_features.pb.h +++ b/src/google/protobuf/cpp_features.pb.h @@ -94,9 +94,9 @@ class PROTOBUF_EXPORT CppFeatures final : } inline CppFeatures& operator=(CppFeatures&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -140,10 +140,10 @@ class PROTOBUF_EXPORT CppFeatures final : inline void Swap(CppFeatures* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -152,7 +152,7 @@ class PROTOBUF_EXPORT CppFeatures final : } void UnsafeArenaSwap(CppFeatures* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index 9beb322fe8..4b94b63f67 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -723,9 +723,9 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : } inline UninterpretedOption_NamePart& operator=(UninterpretedOption_NamePart&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -769,10 +769,10 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : inline void Swap(UninterpretedOption_NamePart* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -781,7 +781,7 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : } void UnsafeArenaSwap(UninterpretedOption_NamePart* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -919,9 +919,9 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : } inline SourceCodeInfo_Location& operator=(SourceCodeInfo_Location&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -965,10 +965,10 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : inline void Swap(SourceCodeInfo_Location* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -977,7 +977,7 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : } void UnsafeArenaSwap(SourceCodeInfo_Location* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -1193,9 +1193,9 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : } inline GeneratedCodeInfo_Annotation& operator=(GeneratedCodeInfo_Annotation&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -1239,10 +1239,10 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : inline void Swap(GeneratedCodeInfo_Annotation* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -1251,7 +1251,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : } void UnsafeArenaSwap(GeneratedCodeInfo_Annotation* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -1457,9 +1457,9 @@ class PROTOBUF_EXPORT FieldOptions_EditionDefault final : } inline FieldOptions_EditionDefault& operator=(FieldOptions_EditionDefault&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -1503,10 +1503,10 @@ class PROTOBUF_EXPORT FieldOptions_EditionDefault final : inline void Swap(FieldOptions_EditionDefault* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -1515,7 +1515,7 @@ class PROTOBUF_EXPORT FieldOptions_EditionDefault final : } void UnsafeArenaSwap(FieldOptions_EditionDefault* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -1653,9 +1653,9 @@ class PROTOBUF_EXPORT FeatureSet final : } inline FeatureSet& operator=(FeatureSet&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -1699,10 +1699,10 @@ class PROTOBUF_EXPORT FeatureSet final : inline void Swap(FeatureSet* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -1711,7 +1711,7 @@ class PROTOBUF_EXPORT FeatureSet final : } void UnsafeArenaSwap(FeatureSet* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -2201,9 +2201,9 @@ class PROTOBUF_EXPORT ExtensionRangeOptions_Declaration final : } inline ExtensionRangeOptions_Declaration& operator=(ExtensionRangeOptions_Declaration&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -2247,10 +2247,10 @@ class PROTOBUF_EXPORT ExtensionRangeOptions_Declaration final : inline void Swap(ExtensionRangeOptions_Declaration* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -2259,7 +2259,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions_Declaration final : } void UnsafeArenaSwap(ExtensionRangeOptions_Declaration* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -2442,9 +2442,9 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : } inline EnumDescriptorProto_EnumReservedRange& operator=(EnumDescriptorProto_EnumReservedRange&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -2488,10 +2488,10 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : inline void Swap(EnumDescriptorProto_EnumReservedRange* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -2500,7 +2500,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : } void UnsafeArenaSwap(EnumDescriptorProto_EnumReservedRange* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -2632,9 +2632,9 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : } inline DescriptorProto_ReservedRange& operator=(DescriptorProto_ReservedRange&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -2678,10 +2678,10 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : inline void Swap(DescriptorProto_ReservedRange* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -2690,7 +2690,7 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : } void UnsafeArenaSwap(DescriptorProto_ReservedRange* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -2822,9 +2822,9 @@ class PROTOBUF_EXPORT UninterpretedOption final : } inline UninterpretedOption& operator=(UninterpretedOption&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -2868,10 +2868,10 @@ class PROTOBUF_EXPORT UninterpretedOption final : inline void Swap(UninterpretedOption* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -2880,7 +2880,7 @@ class PROTOBUF_EXPORT UninterpretedOption final : } void UnsafeArenaSwap(UninterpretedOption* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -3104,9 +3104,9 @@ class PROTOBUF_EXPORT SourceCodeInfo final : } inline SourceCodeInfo& operator=(SourceCodeInfo&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -3150,10 +3150,10 @@ class PROTOBUF_EXPORT SourceCodeInfo final : inline void Swap(SourceCodeInfo* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -3162,7 +3162,7 @@ class PROTOBUF_EXPORT SourceCodeInfo final : } void UnsafeArenaSwap(SourceCodeInfo* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -3289,9 +3289,9 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : } inline GeneratedCodeInfo& operator=(GeneratedCodeInfo&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -3335,10 +3335,10 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : inline void Swap(GeneratedCodeInfo* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -3347,7 +3347,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : } void UnsafeArenaSwap(GeneratedCodeInfo* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -3474,9 +3474,9 @@ class PROTOBUF_EXPORT FeatureSetDefaults_FeatureSetEditionDefault final : } inline FeatureSetDefaults_FeatureSetEditionDefault& operator=(FeatureSetDefaults_FeatureSetEditionDefault&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -3520,10 +3520,10 @@ class PROTOBUF_EXPORT FeatureSetDefaults_FeatureSetEditionDefault final : inline void Swap(FeatureSetDefaults_FeatureSetEditionDefault* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -3532,7 +3532,7 @@ class PROTOBUF_EXPORT FeatureSetDefaults_FeatureSetEditionDefault final : } void UnsafeArenaSwap(FeatureSetDefaults_FeatureSetEditionDefault* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -3668,9 +3668,9 @@ class PROTOBUF_EXPORT ServiceOptions final : } inline ServiceOptions& operator=(ServiceOptions&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -3714,10 +3714,10 @@ class PROTOBUF_EXPORT ServiceOptions final : inline void Swap(ServiceOptions* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -3726,7 +3726,7 @@ class PROTOBUF_EXPORT ServiceOptions final : } void UnsafeArenaSwap(ServiceOptions* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -4061,9 +4061,9 @@ class PROTOBUF_EXPORT OneofOptions final : } inline OneofOptions& operator=(OneofOptions&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -4107,10 +4107,10 @@ class PROTOBUF_EXPORT OneofOptions final : inline void Swap(OneofOptions* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -4119,7 +4119,7 @@ class PROTOBUF_EXPORT OneofOptions final : } void UnsafeArenaSwap(OneofOptions* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -4441,9 +4441,9 @@ class PROTOBUF_EXPORT MethodOptions final : } inline MethodOptions& operator=(MethodOptions&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -4487,10 +4487,10 @@ class PROTOBUF_EXPORT MethodOptions final : inline void Swap(MethodOptions* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -4499,7 +4499,7 @@ class PROTOBUF_EXPORT MethodOptions final : } void UnsafeArenaSwap(MethodOptions* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -4868,9 +4868,9 @@ class PROTOBUF_EXPORT MessageOptions final : } inline MessageOptions& operator=(MessageOptions&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -4914,10 +4914,10 @@ class PROTOBUF_EXPORT MessageOptions final : inline void Swap(MessageOptions* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -4926,7 +4926,7 @@ class PROTOBUF_EXPORT MessageOptions final : } void UnsafeArenaSwap(MessageOptions* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -5313,9 +5313,9 @@ class PROTOBUF_EXPORT FileOptions final : } inline FileOptions& operator=(FileOptions&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -5359,10 +5359,10 @@ class PROTOBUF_EXPORT FileOptions final : inline void Swap(FileOptions* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -5371,7 +5371,7 @@ class PROTOBUF_EXPORT FileOptions final : } void UnsafeArenaSwap(FileOptions* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -6034,9 +6034,9 @@ class PROTOBUF_EXPORT FieldOptions final : } inline FieldOptions& operator=(FieldOptions&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -6080,10 +6080,10 @@ class PROTOBUF_EXPORT FieldOptions final : inline void Swap(FieldOptions* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -6092,7 +6092,7 @@ class PROTOBUF_EXPORT FieldOptions final : } void UnsafeArenaSwap(FieldOptions* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -6665,9 +6665,9 @@ class PROTOBUF_EXPORT FeatureSetDefaults final : } inline FeatureSetDefaults& operator=(FeatureSetDefaults&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -6711,10 +6711,10 @@ class PROTOBUF_EXPORT FeatureSetDefaults final : inline void Swap(FeatureSetDefaults* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -6723,7 +6723,7 @@ class PROTOBUF_EXPORT FeatureSetDefaults final : } void UnsafeArenaSwap(FeatureSetDefaults* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -6877,9 +6877,9 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : } inline ExtensionRangeOptions& operator=(ExtensionRangeOptions&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -6923,10 +6923,10 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : inline void Swap(ExtensionRangeOptions* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -6935,7 +6935,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : } void UnsafeArenaSwap(ExtensionRangeOptions* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -7312,9 +7312,9 @@ class PROTOBUF_EXPORT EnumValueOptions final : } inline EnumValueOptions& operator=(EnumValueOptions&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -7358,10 +7358,10 @@ class PROTOBUF_EXPORT EnumValueOptions final : inline void Swap(EnumValueOptions* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -7370,7 +7370,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : } void UnsafeArenaSwap(EnumValueOptions* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -7718,9 +7718,9 @@ class PROTOBUF_EXPORT EnumOptions final : } inline EnumOptions& operator=(EnumOptions&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -7764,10 +7764,10 @@ class PROTOBUF_EXPORT EnumOptions final : inline void Swap(EnumOptions* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -7776,7 +7776,7 @@ class PROTOBUF_EXPORT EnumOptions final : } void UnsafeArenaSwap(EnumOptions* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -8137,9 +8137,9 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : } inline OneofDescriptorProto& operator=(OneofDescriptorProto&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -8183,10 +8183,10 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : inline void Swap(OneofDescriptorProto* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -8195,7 +8195,7 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : } void UnsafeArenaSwap(OneofDescriptorProto* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -8337,9 +8337,9 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : } inline MethodDescriptorProto& operator=(MethodDescriptorProto&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -8383,10 +8383,10 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : inline void Swap(MethodDescriptorProto* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -8395,7 +8395,7 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : } void UnsafeArenaSwap(MethodDescriptorProto* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -8601,9 +8601,9 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : } inline FieldDescriptorProto& operator=(FieldDescriptorProto&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -8647,10 +8647,10 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : inline void Swap(FieldDescriptorProto* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -8659,7 +8659,7 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : } void UnsafeArenaSwap(FieldDescriptorProto* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -8999,9 +8999,9 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : } inline EnumValueDescriptorProto& operator=(EnumValueDescriptorProto&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -9045,10 +9045,10 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : inline void Swap(EnumValueDescriptorProto* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -9057,7 +9057,7 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : } void UnsafeArenaSwap(EnumValueDescriptorProto* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -9212,9 +9212,9 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : } inline DescriptorProto_ExtensionRange& operator=(DescriptorProto_ExtensionRange&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -9258,10 +9258,10 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : inline void Swap(DescriptorProto_ExtensionRange* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -9270,7 +9270,7 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : } void UnsafeArenaSwap(DescriptorProto_ExtensionRange* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -9419,9 +9419,9 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : } inline ServiceDescriptorProto& operator=(ServiceDescriptorProto&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -9465,10 +9465,10 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : inline void Swap(ServiceDescriptorProto* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -9477,7 +9477,7 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : } void UnsafeArenaSwap(ServiceDescriptorProto* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -9639,9 +9639,9 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : } inline EnumDescriptorProto& operator=(EnumDescriptorProto&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -9685,10 +9685,10 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : inline void Swap(EnumDescriptorProto* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -9697,7 +9697,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : } void UnsafeArenaSwap(EnumDescriptorProto* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -9911,9 +9911,9 @@ class PROTOBUF_EXPORT DescriptorProto final : } inline DescriptorProto& operator=(DescriptorProto&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -9957,10 +9957,10 @@ class PROTOBUF_EXPORT DescriptorProto final : inline void Swap(DescriptorProto* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -9969,7 +9969,7 @@ class PROTOBUF_EXPORT DescriptorProto final : } void UnsafeArenaSwap(DescriptorProto* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -10284,9 +10284,9 @@ class PROTOBUF_EXPORT FileDescriptorProto final : } inline FileDescriptorProto& operator=(FileDescriptorProto&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -10330,10 +10330,10 @@ class PROTOBUF_EXPORT FileDescriptorProto final : inline void Swap(FileDescriptorProto* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -10342,7 +10342,7 @@ class PROTOBUF_EXPORT FileDescriptorProto final : } void UnsafeArenaSwap(FileDescriptorProto* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } @@ -10702,9 +10702,9 @@ class PROTOBUF_EXPORT FileDescriptorSet final : } inline FileDescriptorSet& operator=(FileDescriptorSet&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() + if (GetArena() == from.GetArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr + && GetArena() != nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); @@ -10748,10 +10748,10 @@ class PROTOBUF_EXPORT FileDescriptorSet final : inline void Swap(FileDescriptorSet* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { + if (GetArena() == other->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { @@ -10760,7 +10760,7 @@ class PROTOBUF_EXPORT FileDescriptorSet final : } void UnsafeArenaSwap(FileDescriptorSet* other) { if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } diff --git a/src/google/protobuf/extension_set.cc b/src/google/protobuf/extension_set.cc index 622c86ae15..4b54d7a3b6 100644 --- a/src/google/protobuf/extension_set.cc +++ b/src/google/protobuf/extension_set.cc @@ -626,9 +626,8 @@ void ExtensionSet::SetAllocatedMessage(int number, FieldType type, ClearExtension(number); return; } - ABSL_DCHECK(message->GetOwningArena() == nullptr || - message->GetOwningArena() == arena_); - Arena* message_arena = message->GetOwningArena(); + ABSL_DCHECK(message->GetArena() == nullptr || message->GetArena() == arena_); + Arena* message_arena = message->GetArena(); Extension* extension; if (MaybeNewExtension(number, descriptor, &extension)) { extension->type = type; diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc index 1e9be1ee22..452fd5240d 100644 --- a/src/google/protobuf/generated_message_reflection.cc +++ b/src/google/protobuf/generated_message_reflection.cc @@ -1064,16 +1064,16 @@ void Reflection::Swap(Message* message1, Message* message2) const { // Check that both messages are in the same arena (or both on the heap). We // need to copy all data if not, due to ownership semantics. #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (message1->GetOwningArena() == nullptr || - message1->GetOwningArena() != message2->GetOwningArena()) { + if (message1->GetArena() == nullptr || + message1->GetArena() != message2->GetArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (message1->GetOwningArena() != message2->GetOwningArena()) { + if (message1->GetArena() != message2->GetArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP // One of the two is guaranteed to have an arena. Switch things around // to guarantee that message1 has an arena. - Arena* arena = message1->GetOwningArena(); + Arena* arena = message1->GetArena(); if (arena == nullptr) { - arena = message2->GetOwningArena(); + arena = message2->GetArena(); std::swap(message1, message2); // Swapping names for pointers! } @@ -1203,7 +1203,7 @@ bool Reflection::HasField(const Message& message, } void Reflection::UnsafeArenaSwap(Message* lhs, Message* rhs) const { - ABSL_DCHECK_EQ(lhs->GetOwningArena(), rhs->GetOwningArena()); + ABSL_DCHECK_EQ(lhs->GetArena(), rhs->GetArena()); InternalSwap(lhs, rhs); } @@ -2311,17 +2311,15 @@ void Reflection::UnsafeArenaSetAllocatedMessage( void Reflection::SetAllocatedMessage(Message* message, Message* sub_message, const FieldDescriptor* field) const { - ABSL_DCHECK(sub_message == nullptr || - sub_message->GetOwningArena() == nullptr || - sub_message->GetOwningArena() == message->GetArena()); + ABSL_DCHECK(sub_message == nullptr || sub_message->GetArena() == nullptr || + sub_message->GetArena() == message->GetArena()); // If message and sub-message are in different memory ownership domains // (different arenas, or one is on heap and one is not), then we may need to // do a copy. if (sub_message != nullptr && - sub_message->GetOwningArena() != message->GetArena()) { - if (sub_message->GetOwningArena() == nullptr && - message->GetArena() != nullptr) { + sub_message->GetArena() != message->GetArena()) { + if (sub_message->GetArena() == nullptr && message->GetArena() != nullptr) { // Case 1: parent is on an arena and child is heap-allocated. We can add // the child to the arena's Own() list to free on arena destruction, then // set our pointer. diff --git a/src/google/protobuf/generated_message_tctable_lite.cc b/src/google/protobuf/generated_message_tctable_lite.cc index 77f66b0557..531d0556a7 100644 --- a/src/google/protobuf/generated_message_tctable_lite.cc +++ b/src/google/protobuf/generated_message_tctable_lite.cc @@ -1557,7 +1557,7 @@ PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedString( } }; - auto* arena = field.GetOwningArena(); + auto* arena = field.GetArena(); SerialArena* serial_arena; if (PROTOBUF_PREDICT_TRUE(arena != nullptr && arena->impl_.GetSerialArenaFast(&serial_arena) && @@ -2260,7 +2260,7 @@ PROTOBUF_NOINLINE const char* TcParser::MpRepeatedString( const char* ptr2 = ptr; uint32_t next_tag; - auto* arena = field.GetOwningArena(); + auto* arena = field.GetArena(); SerialArena* serial_arena; if (PROTOBUF_PREDICT_TRUE( arena != nullptr &&