Skip to content

Commit

Permalink
Use GetArena() instead of GetOwningArena() #1
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 573070911
  • Loading branch information
protobuf-github-bot authored and Copybara-Service committed Oct 13, 2023
1 parent 7eef3c9 commit c80298b
Show file tree
Hide file tree
Showing 9 changed files with 250 additions and 253 deletions.
4 changes: 2 additions & 2 deletions src/google/protobuf/arena_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/google/protobuf/compiler/cpp/message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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");

Expand Down
12 changes: 6 additions & 6 deletions src/google/protobuf/compiler/java/java_features.pb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 24 additions & 24 deletions src/google/protobuf/compiler/plugin.pb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/google/protobuf/cpp_features.pb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c80298b

Please sign in to comment.