diff --git a/src/google/protobuf/compiler/cpp/field_generators/enum_field.cc b/src/google/protobuf/compiler/cpp/field_generators/enum_field.cc index b974f78463..ada4b098c2 100644 --- a/src/google/protobuf/compiler/cpp/field_generators/enum_field.cc +++ b/src/google/protobuf/compiler/cpp/field_generators/enum_field.cc @@ -283,7 +283,7 @@ class RepeatedEnum : public FieldGeneratorBase { void GenerateDestructorCode(io::Printer* p) const override { if (should_split()) { p->Emit(R"cc( - $field_$.DeleteIfNotDefault(); + this_.$field_$.DeleteIfNotDefault(); )cc"); } } diff --git a/src/google/protobuf/compiler/cpp/field_generators/message_field.cc b/src/google/protobuf/compiler/cpp/field_generators/message_field.cc index f304011111..197df616e6 100644 --- a/src/google/protobuf/compiler/cpp/field_generators/message_field.cc +++ b/src/google/protobuf/compiler/cpp/field_generators/message_field.cc @@ -379,7 +379,7 @@ void SingularMessage::GenerateDestructorCode(io::Printer* p) const { )cc"); } else { p->Emit(R"cc( - delete $field_$; + delete this_.$field_$; )cc"); } } @@ -924,7 +924,7 @@ void RepeatedMessage::GenerateCopyConstructorCode(io::Printer* p) const { void RepeatedMessage::GenerateDestructorCode(io::Printer* p) const { if (should_split()) { p->Emit(R"cc( - $field_$.DeleteIfNotDefault(); + this_.$field_$.DeleteIfNotDefault(); )cc"); } } diff --git a/src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc b/src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc index 7590512e5a..5a40629d2c 100644 --- a/src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc +++ b/src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc @@ -332,7 +332,7 @@ class RepeatedPrimitive final : public FieldGeneratorBase { void GenerateDestructorCode(io::Printer* p) const override { if (should_split()) { p->Emit(R"cc( - $field_$.DeleteIfNotDefault(); + this_.$field_$.DeleteIfNotDefault(); )cc"); } } diff --git a/src/google/protobuf/compiler/cpp/field_generators/string_field.cc b/src/google/protobuf/compiler/cpp/field_generators/string_field.cc index fcca9dfc33..66e908d247 100644 --- a/src/google/protobuf/compiler/cpp/field_generators/string_field.cc +++ b/src/google/protobuf/compiler/cpp/field_generators/string_field.cc @@ -675,7 +675,7 @@ void SingularString::GenerateDestructorCode(io::Printer* p) const { } p->Emit(R"cc( - $field_$.Destroy(); + this_.$field_$.Destroy(); )cc"); } @@ -785,7 +785,7 @@ class RepeatedString : public FieldGeneratorBase { void GenerateDestructorCode(io::Printer* p) const override { if (should_split()) { p->Emit(R"cc( - $field_$.DeleteIfNotDefault(); + this_.$field_$.DeleteIfNotDefault(); )cc"); } } diff --git a/src/google/protobuf/compiler/cpp/field_generators/string_view_field.cc b/src/google/protobuf/compiler/cpp/field_generators/string_view_field.cc index 613f7aca9c..7cf3c7fc19 100644 --- a/src/google/protobuf/compiler/cpp/field_generators/string_view_field.cc +++ b/src/google/protobuf/compiler/cpp/field_generators/string_view_field.cc @@ -492,7 +492,7 @@ void SingularStringView::GenerateDestructorCode(io::Printer* p) const { } p->Emit(R"cc( - $field_$.Destroy(); + this_.$field_$.Destroy(); )cc"); } @@ -602,7 +602,7 @@ class RepeatedStringView : public FieldGeneratorBase { void GenerateDestructorCode(io::Printer* p) const override { if (should_split()) { p->Emit(R"cc( - $field_$.DeleteIfNotDefault(); + this_.$field_$.DeleteIfNotDefault(); )cc"); } } diff --git a/src/google/protobuf/compiler/cpp/message.cc b/src/google/protobuf/compiler/cpp/message.cc index a5b9aaab10..6daea78ece 100644 --- a/src/google/protobuf/compiler/cpp/message.cc +++ b/src/google/protobuf/compiler/cpp/message.cc @@ -1905,7 +1905,7 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* p) { private: void SharedCtor(::$proto_ns$::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap($classname$* other); )cc"); }}, @@ -2070,6 +2070,16 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* p) { public: inline $classname$() : $classname$(nullptr) {} $decl_dtor$; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + //~ Define a derived `operator delete` to avoid dynamic dispatch when + //~ the type is statically known + void operator delete($classname$* msg, std::destroying_delete_t) { + SharedDtor(*msg); + $pbi$::SizedDelete(msg, sizeof($classname$)); + } +#endif + //~ Templatize constexpr constructor as a workaround for a bug in //~ gcc 12 (warning in gcc 13). template @@ -2865,8 +2875,8 @@ void MessageGenerator::GenerateSharedDestructorCode(io::Printer* p) { [&] { emit_field_dtors(/* split_fields= */ true); }}, }, R"cc( - if (PROTOBUF_PREDICT_FALSE(!IsSplitMessageDefault())) { - auto* $cached_split_ptr$ = $split$; + if (PROTOBUF_PREDICT_FALSE(!this_.IsSplitMessageDefault())) { + auto* $cached_split_ptr$ = this_.$split$; $split_field_dtors_impl$; delete $cached_split_ptr$; } @@ -2877,8 +2887,8 @@ void MessageGenerator::GenerateSharedDestructorCode(io::Printer* p) { for (const auto* oneof : OneOfRange(descriptor_)) { p->Emit({{"name", oneof->name()}}, R"cc( - if (has_$name$()) { - clear_$name$(); + if (this_.has_$name$()) { + this_.clear_$name$(); } )cc"); } @@ -2888,14 +2898,16 @@ void MessageGenerator::GenerateSharedDestructorCode(io::Printer* p) { if (num_weak_fields_ == 0) return; // Generate code to destruct oneofs. Clearing should do the work. p->Emit(R"cc( - $weak_field_map$.ClearAll(); + this_.$weak_field_map$.ClearAll(); )cc"); }}, - {"impl_dtor", [&] { p->Emit("_impl_.~Impl_();\n"); }}, + {"impl_dtor", [&] { p->Emit("this_._impl_.~Impl_();\n"); }}, }, R"cc( - inline void $classname$::SharedDtor() { - $DCHK$(GetArena() == nullptr); + inline void $classname$::SharedDtor(MessageLite& self) { + $classname$& this_ = static_cast<$classname$&>(self); + this_._internal_metadata_.Delete<$unknown_fields_type$>(); + $DCHK$(this_.GetArena() == nullptr); $WeakDescriptorSelfPin$; $field_dtors$; $split_field_dtors$; @@ -3400,8 +3412,7 @@ void MessageGenerator::GenerateStructors(io::Printer* p) { R"cc( $classname$::~$classname$() { // @@protoc_insertion_point(destructor:$full_name$) - _internal_metadata_.Delete<$unknown_fields_type$>(); - SharedDtor(); + SharedDtor(*this); } )cc"); } @@ -4054,7 +4065,7 @@ void MessageGenerator::GenerateClassData(io::Printer* p) { &$classname$::MergeImpl, $superclass$::GetNewImpl<$classname$>(), #if defined(PROTOBUF_CUSTOM_VTABLE) - $superclass$::GetDeleteImpl<$classname$>(), + &$classname$::SharedDtor, $custom_vtable_methods$, #endif // PROTOBUF_CUSTOM_VTABLE PROTOBUF_FIELD_OFFSET($classname$, $cached_size$), @@ -4092,7 +4103,7 @@ void MessageGenerator::GenerateClassData(io::Printer* p) { &$classname$::MergeImpl, $superclass$::GetNewImpl<$classname$>(), #if defined(PROTOBUF_CUSTOM_VTABLE) - $superclass$::GetDeleteImpl<$classname$>(), + &$classname$::SharedDtor, $custom_vtable_methods$, #endif // PROTOBUF_CUSTOM_VTABLE PROTOBUF_FIELD_OFFSET($classname$, $cached_size$), diff --git a/src/google/protobuf/compiler/java/java_features.pb.cc b/src/google/protobuf/compiler/java/java_features.pb.cc index 4c92088b6c..045a4f061d 100644 --- a/src/google/protobuf/compiler/java/java_features.pb.cc +++ b/src/google/protobuf/compiler/java/java_features.pb.cc @@ -186,12 +186,13 @@ inline void JavaFeatures::SharedCtor(::_pb::Arena* arena) { } JavaFeatures::~JavaFeatures() { // @@protoc_insertion_point(destructor:pb.JavaFeatures) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void JavaFeatures::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); +inline void JavaFeatures::SharedDtor(MessageLite& self) { + JavaFeatures& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); } inline void* JavaFeatures::PlacementNew_(const void*, void* mem, @@ -213,7 +214,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &JavaFeatures::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &JavaFeatures::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &JavaFeatures::ByteSizeLong, &JavaFeatures::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE diff --git a/src/google/protobuf/compiler/java/java_features.pb.h b/src/google/protobuf/compiler/java/java_features.pb.h index 1524567c4f..95fcbc0cc0 100644 --- a/src/google/protobuf/compiler/java/java_features.pb.h +++ b/src/google/protobuf/compiler/java/java_features.pb.h @@ -105,6 +105,14 @@ class PROTOC_EXPORT JavaFeatures final public: inline JavaFeatures() : JavaFeatures(nullptr) {} ~JavaFeatures() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(JavaFeatures* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(JavaFeatures)); + } +#endif + template explicit PROTOBUF_CONSTEXPR JavaFeatures( ::google::protobuf::internal::ConstantInitialized); @@ -211,7 +219,7 @@ class PROTOC_EXPORT JavaFeatures final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(JavaFeatures* other); private: template diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 3f22130ece..d08ad02fb1 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -383,13 +383,14 @@ inline void Version::SharedCtor(::_pb::Arena* arena) { } Version::~Version() { // @@protoc_insertion_point(destructor:google.protobuf.compiler.Version) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void Version::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.suffix_.Destroy(); - _impl_.~Impl_(); +inline void Version::SharedDtor(MessageLite& self) { + Version& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.suffix_.Destroy(); + this_._impl_.~Impl_(); } inline void* Version::PlacementNew_(const void*, void* mem, @@ -411,7 +412,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &Version::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &Version::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &Version::ByteSizeLong, &Version::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -723,14 +724,15 @@ inline void CodeGeneratorRequest::SharedCtor(::_pb::Arena* arena) { } CodeGeneratorRequest::~CodeGeneratorRequest() { // @@protoc_insertion_point(destructor:google.protobuf.compiler.CodeGeneratorRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void CodeGeneratorRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.parameter_.Destroy(); - delete _impl_.compiler_version_; - _impl_.~Impl_(); +inline void CodeGeneratorRequest::SharedDtor(MessageLite& self) { + CodeGeneratorRequest& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.parameter_.Destroy(); + delete this_._impl_.compiler_version_; + this_._impl_.~Impl_(); } inline void* CodeGeneratorRequest::PlacementNew_(const void*, void* mem, @@ -771,7 +773,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &CodeGeneratorRequest::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &CodeGeneratorRequest::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &CodeGeneratorRequest::ByteSizeLong, &CodeGeneratorRequest::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -1136,16 +1138,17 @@ inline void CodeGeneratorResponse_File::SharedCtor(::_pb::Arena* arena) { } CodeGeneratorResponse_File::~CodeGeneratorResponse_File() { // @@protoc_insertion_point(destructor:google.protobuf.compiler.CodeGeneratorResponse.File) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void CodeGeneratorResponse_File::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_.Destroy(); - _impl_.insertion_point_.Destroy(); - _impl_.content_.Destroy(); - delete _impl_.generated_code_info_; - _impl_.~Impl_(); +inline void CodeGeneratorResponse_File::SharedDtor(MessageLite& self) { + CodeGeneratorResponse_File& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + this_._impl_.insertion_point_.Destroy(); + this_._impl_.content_.Destroy(); + delete this_._impl_.generated_code_info_; + this_._impl_.~Impl_(); } inline void* CodeGeneratorResponse_File::PlacementNew_(const void*, void* mem, @@ -1167,7 +1170,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &CodeGeneratorResponse_File::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &CodeGeneratorResponse_File::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &CodeGeneratorResponse_File::ByteSizeLong, &CodeGeneratorResponse_File::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -1490,13 +1493,14 @@ inline void CodeGeneratorResponse::SharedCtor(::_pb::Arena* arena) { } CodeGeneratorResponse::~CodeGeneratorResponse() { // @@protoc_insertion_point(destructor:google.protobuf.compiler.CodeGeneratorResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void CodeGeneratorResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.error_.Destroy(); - _impl_.~Impl_(); +inline void CodeGeneratorResponse::SharedDtor(MessageLite& self) { + CodeGeneratorResponse& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.error_.Destroy(); + this_._impl_.~Impl_(); } inline void* CodeGeneratorResponse::PlacementNew_(const void*, void* mem, @@ -1529,7 +1533,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &CodeGeneratorResponse::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &CodeGeneratorResponse::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &CodeGeneratorResponse::ByteSizeLong, &CodeGeneratorResponse::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index 293cd5cac0..eb3e22568c 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -122,6 +122,14 @@ class PROTOC_EXPORT Version final public: inline Version() : Version(nullptr) {} ~Version() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(Version* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Version)); + } +#endif + template explicit PROTOBUF_CONSTEXPR Version( ::google::protobuf::internal::ConstantInitialized); @@ -228,7 +236,7 @@ class PROTOC_EXPORT Version final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(Version* other); private: template @@ -353,6 +361,14 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final public: inline CodeGeneratorResponse_File() : CodeGeneratorResponse_File(nullptr) {} ~CodeGeneratorResponse_File() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(CodeGeneratorResponse_File* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(CodeGeneratorResponse_File)); + } +#endif + template explicit PROTOBUF_CONSTEXPR CodeGeneratorResponse_File( ::google::protobuf::internal::ConstantInitialized); @@ -459,7 +475,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(CodeGeneratorResponse_File* other); private: template @@ -600,6 +616,14 @@ class PROTOC_EXPORT CodeGeneratorResponse final public: inline CodeGeneratorResponse() : CodeGeneratorResponse(nullptr) {} ~CodeGeneratorResponse() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(CodeGeneratorResponse* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(CodeGeneratorResponse)); + } +#endif + template explicit PROTOBUF_CONSTEXPR CodeGeneratorResponse( ::google::protobuf::internal::ConstantInitialized); @@ -706,7 +730,7 @@ class PROTOC_EXPORT CodeGeneratorResponse final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(CodeGeneratorResponse* other); private: template @@ -871,6 +895,14 @@ class PROTOC_EXPORT CodeGeneratorRequest final public: inline CodeGeneratorRequest() : CodeGeneratorRequest(nullptr) {} ~CodeGeneratorRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(CodeGeneratorRequest* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(CodeGeneratorRequest)); + } +#endif + template explicit PROTOBUF_CONSTEXPR CodeGeneratorRequest( ::google::protobuf::internal::ConstantInitialized); @@ -982,7 +1014,7 @@ class PROTOC_EXPORT CodeGeneratorRequest final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(CodeGeneratorRequest* other); private: template diff --git a/src/google/protobuf/cpp_features.pb.cc b/src/google/protobuf/cpp_features.pb.cc index 50f1979657..b98ae6f8b9 100644 --- a/src/google/protobuf/cpp_features.pb.cc +++ b/src/google/protobuf/cpp_features.pb.cc @@ -186,12 +186,13 @@ inline void CppFeatures::SharedCtor(::_pb::Arena* arena) { } CppFeatures::~CppFeatures() { // @@protoc_insertion_point(destructor:pb.CppFeatures) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void CppFeatures::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); +inline void CppFeatures::SharedDtor(MessageLite& self) { + CppFeatures& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); } inline void* CppFeatures::PlacementNew_(const void*, void* mem, @@ -213,7 +214,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &CppFeatures::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &CppFeatures::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &CppFeatures::ByteSizeLong, &CppFeatures::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE diff --git a/src/google/protobuf/cpp_features.pb.h b/src/google/protobuf/cpp_features.pb.h index 908dc0f01a..2ab01b68e6 100644 --- a/src/google/protobuf/cpp_features.pb.h +++ b/src/google/protobuf/cpp_features.pb.h @@ -106,6 +106,14 @@ class PROTOBUF_EXPORT CppFeatures final public: inline CppFeatures() : CppFeatures(nullptr) {} ~CppFeatures() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(CppFeatures* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(CppFeatures)); + } +#endif + template explicit PROTOBUF_CONSTEXPR CppFeatures( ::google::protobuf::internal::ConstantInitialized); @@ -212,7 +220,7 @@ class PROTOBUF_EXPORT CppFeatures final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(CppFeatures* other); private: template diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 2e07e9bd7b..7c03d888a4 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -2648,12 +2648,13 @@ inline void FileDescriptorSet::SharedCtor(::_pb::Arena* arena) { } FileDescriptorSet::~FileDescriptorSet() { // @@protoc_insertion_point(destructor:google.protobuf.FileDescriptorSet) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void FileDescriptorSet::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); +inline void FileDescriptorSet::SharedDtor(MessageLite& self) { + FileDescriptorSet& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); } inline void* FileDescriptorSet::PlacementNew_(const void*, void* mem, @@ -2686,7 +2687,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &FileDescriptorSet::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &FileDescriptorSet::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &FileDescriptorSet::ByteSizeLong, &FileDescriptorSet::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -2931,17 +2932,18 @@ inline void FileDescriptorProto::SharedCtor(::_pb::Arena* arena) { } FileDescriptorProto::~FileDescriptorProto() { // @@protoc_insertion_point(destructor:google.protobuf.FileDescriptorProto) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void FileDescriptorProto::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_.Destroy(); - _impl_.package_.Destroy(); - _impl_.syntax_.Destroy(); - delete _impl_.options_; - delete _impl_.source_code_info_; - _impl_.~Impl_(); +inline void FileDescriptorProto::SharedDtor(MessageLite& self) { + FileDescriptorProto& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + this_._impl_.package_.Destroy(); + this_._impl_.syntax_.Destroy(); + delete this_._impl_.options_; + delete this_._impl_.source_code_info_; + this_._impl_.~Impl_(); } inline void* FileDescriptorProto::PlacementNew_(const void*, void* mem, @@ -2998,7 +3000,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &FileDescriptorProto::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &FileDescriptorProto::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &FileDescriptorProto::ByteSizeLong, &FileDescriptorProto::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -3592,13 +3594,14 @@ inline void DescriptorProto_ExtensionRange::SharedCtor(::_pb::Arena* arena) { } DescriptorProto_ExtensionRange::~DescriptorProto_ExtensionRange() { // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto.ExtensionRange) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void DescriptorProto_ExtensionRange::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.options_; - _impl_.~Impl_(); +inline void DescriptorProto_ExtensionRange::SharedDtor(MessageLite& self) { + DescriptorProto_ExtensionRange& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.options_; + this_._impl_.~Impl_(); } inline void* DescriptorProto_ExtensionRange::PlacementNew_(const void*, void* mem, @@ -3620,7 +3623,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &DescriptorProto_ExtensionRange::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &DescriptorProto_ExtensionRange::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &DescriptorProto_ExtensionRange::ByteSizeLong, &DescriptorProto_ExtensionRange::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -3888,12 +3891,13 @@ inline void DescriptorProto_ReservedRange::SharedCtor(::_pb::Arena* arena) { } DescriptorProto_ReservedRange::~DescriptorProto_ReservedRange() { // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto.ReservedRange) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void DescriptorProto_ReservedRange::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); +inline void DescriptorProto_ReservedRange::SharedDtor(MessageLite& self) { + DescriptorProto_ReservedRange& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); } inline void* DescriptorProto_ReservedRange::PlacementNew_(const void*, void* mem, @@ -3915,7 +3919,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &DescriptorProto_ReservedRange::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &DescriptorProto_ReservedRange::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &DescriptorProto_ReservedRange::ByteSizeLong, &DescriptorProto_ReservedRange::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -4176,14 +4180,15 @@ inline void DescriptorProto::SharedCtor(::_pb::Arena* arena) { } DescriptorProto::~DescriptorProto() { // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void DescriptorProto::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_.Destroy(); - delete _impl_.options_; - _impl_.~Impl_(); +inline void DescriptorProto::SharedDtor(MessageLite& self) { + DescriptorProto& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + delete this_._impl_.options_; + this_._impl_.~Impl_(); } inline void* DescriptorProto::PlacementNew_(const void*, void* mem, @@ -4244,7 +4249,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &DescriptorProto::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &DescriptorProto::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &DescriptorProto::ByteSizeLong, &DescriptorProto::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -4770,14 +4775,15 @@ inline void ExtensionRangeOptions_Declaration::SharedCtor(::_pb::Arena* arena) { } ExtensionRangeOptions_Declaration::~ExtensionRangeOptions_Declaration() { // @@protoc_insertion_point(destructor:google.protobuf.ExtensionRangeOptions.Declaration) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void ExtensionRangeOptions_Declaration::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.full_name_.Destroy(); - _impl_.type_.Destroy(); - _impl_.~Impl_(); +inline void ExtensionRangeOptions_Declaration::SharedDtor(MessageLite& self) { + ExtensionRangeOptions_Declaration& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.full_name_.Destroy(); + this_._impl_.type_.Destroy(); + this_._impl_.~Impl_(); } inline void* ExtensionRangeOptions_Declaration::PlacementNew_(const void*, void* mem, @@ -4799,7 +4805,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &ExtensionRangeOptions_Declaration::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &ExtensionRangeOptions_Declaration::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &ExtensionRangeOptions_Declaration::ByteSizeLong, &ExtensionRangeOptions_Declaration::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -5133,13 +5139,14 @@ inline void ExtensionRangeOptions::SharedCtor(::_pb::Arena* arena) { } ExtensionRangeOptions::~ExtensionRangeOptions() { // @@protoc_insertion_point(destructor:google.protobuf.ExtensionRangeOptions) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void ExtensionRangeOptions::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.features_; - _impl_.~Impl_(); +inline void ExtensionRangeOptions::SharedDtor(MessageLite& self) { + ExtensionRangeOptions& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.features_; + this_._impl_.~Impl_(); } inline void* ExtensionRangeOptions::PlacementNew_(const void*, void* mem, @@ -5179,7 +5186,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &ExtensionRangeOptions::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &ExtensionRangeOptions::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &ExtensionRangeOptions::ByteSizeLong, &ExtensionRangeOptions::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -5542,18 +5549,19 @@ inline void FieldDescriptorProto::SharedCtor(::_pb::Arena* arena) { } FieldDescriptorProto::~FieldDescriptorProto() { // @@protoc_insertion_point(destructor:google.protobuf.FieldDescriptorProto) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void FieldDescriptorProto::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_.Destroy(); - _impl_.extendee_.Destroy(); - _impl_.type_name_.Destroy(); - _impl_.default_value_.Destroy(); - _impl_.json_name_.Destroy(); - delete _impl_.options_; - _impl_.~Impl_(); +inline void FieldDescriptorProto::SharedDtor(MessageLite& self) { + FieldDescriptorProto& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + this_._impl_.extendee_.Destroy(); + this_._impl_.type_name_.Destroy(); + this_._impl_.default_value_.Destroy(); + this_._impl_.json_name_.Destroy(); + delete this_._impl_.options_; + this_._impl_.~Impl_(); } inline void* FieldDescriptorProto::PlacementNew_(const void*, void* mem, @@ -5575,7 +5583,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &FieldDescriptorProto::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &FieldDescriptorProto::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &FieldDescriptorProto::ByteSizeLong, &FieldDescriptorProto::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -6077,14 +6085,15 @@ inline void OneofDescriptorProto::SharedCtor(::_pb::Arena* arena) { } OneofDescriptorProto::~OneofDescriptorProto() { // @@protoc_insertion_point(destructor:google.protobuf.OneofDescriptorProto) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void OneofDescriptorProto::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_.Destroy(); - delete _impl_.options_; - _impl_.~Impl_(); +inline void OneofDescriptorProto::SharedDtor(MessageLite& self) { + OneofDescriptorProto& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + delete this_._impl_.options_; + this_._impl_.~Impl_(); } inline void* OneofDescriptorProto::PlacementNew_(const void*, void* mem, @@ -6106,7 +6115,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &OneofDescriptorProto::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &OneofDescriptorProto::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &OneofDescriptorProto::ByteSizeLong, &OneofDescriptorProto::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -6354,12 +6363,13 @@ inline void EnumDescriptorProto_EnumReservedRange::SharedCtor(::_pb::Arena* aren } EnumDescriptorProto_EnumReservedRange::~EnumDescriptorProto_EnumReservedRange() { // @@protoc_insertion_point(destructor:google.protobuf.EnumDescriptorProto.EnumReservedRange) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void EnumDescriptorProto_EnumReservedRange::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); +inline void EnumDescriptorProto_EnumReservedRange::SharedDtor(MessageLite& self) { + EnumDescriptorProto_EnumReservedRange& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); } inline void* EnumDescriptorProto_EnumReservedRange::PlacementNew_(const void*, void* mem, @@ -6381,7 +6391,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &EnumDescriptorProto_EnumReservedRange::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &EnumDescriptorProto_EnumReservedRange::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &EnumDescriptorProto_EnumReservedRange::ByteSizeLong, &EnumDescriptorProto_EnumReservedRange::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -6632,14 +6642,15 @@ inline void EnumDescriptorProto::SharedCtor(::_pb::Arena* arena) { } EnumDescriptorProto::~EnumDescriptorProto() { // @@protoc_insertion_point(destructor:google.protobuf.EnumDescriptorProto) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void EnumDescriptorProto::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_.Destroy(); - delete _impl_.options_; - _impl_.~Impl_(); +inline void EnumDescriptorProto::SharedDtor(MessageLite& self) { + EnumDescriptorProto& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + delete this_._impl_.options_; + this_._impl_.~Impl_(); } inline void* EnumDescriptorProto::PlacementNew_(const void*, void* mem, @@ -6680,7 +6691,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &EnumDescriptorProto::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &EnumDescriptorProto::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &EnumDescriptorProto::ByteSizeLong, &EnumDescriptorProto::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -7044,14 +7055,15 @@ inline void EnumValueDescriptorProto::SharedCtor(::_pb::Arena* arena) { } EnumValueDescriptorProto::~EnumValueDescriptorProto() { // @@protoc_insertion_point(destructor:google.protobuf.EnumValueDescriptorProto) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void EnumValueDescriptorProto::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_.Destroy(); - delete _impl_.options_; - _impl_.~Impl_(); +inline void EnumValueDescriptorProto::SharedDtor(MessageLite& self) { + EnumValueDescriptorProto& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + delete this_._impl_.options_; + this_._impl_.~Impl_(); } inline void* EnumValueDescriptorProto::PlacementNew_(const void*, void* mem, @@ -7073,7 +7085,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &EnumValueDescriptorProto::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &EnumValueDescriptorProto::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &EnumValueDescriptorProto::ByteSizeLong, &EnumValueDescriptorProto::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -7369,14 +7381,15 @@ inline void ServiceDescriptorProto::SharedCtor(::_pb::Arena* arena) { } ServiceDescriptorProto::~ServiceDescriptorProto() { // @@protoc_insertion_point(destructor:google.protobuf.ServiceDescriptorProto) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void ServiceDescriptorProto::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_.Destroy(); - delete _impl_.options_; - _impl_.~Impl_(); +inline void ServiceDescriptorProto::SharedDtor(MessageLite& self) { + ServiceDescriptorProto& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + delete this_._impl_.options_; + this_._impl_.~Impl_(); } inline void* ServiceDescriptorProto::PlacementNew_(const void*, void* mem, @@ -7409,7 +7422,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &ServiceDescriptorProto::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &ServiceDescriptorProto::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &ServiceDescriptorProto::ByteSizeLong, &ServiceDescriptorProto::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -7725,16 +7738,17 @@ inline void MethodDescriptorProto::SharedCtor(::_pb::Arena* arena) { } MethodDescriptorProto::~MethodDescriptorProto() { // @@protoc_insertion_point(destructor:google.protobuf.MethodDescriptorProto) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void MethodDescriptorProto::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_.Destroy(); - _impl_.input_type_.Destroy(); - _impl_.output_type_.Destroy(); - delete _impl_.options_; - _impl_.~Impl_(); +inline void MethodDescriptorProto::SharedDtor(MessageLite& self) { + MethodDescriptorProto& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + this_._impl_.input_type_.Destroy(); + this_._impl_.output_type_.Destroy(); + delete this_._impl_.options_; + this_._impl_.~Impl_(); } inline void* MethodDescriptorProto::PlacementNew_(const void*, void* mem, @@ -7756,7 +7770,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &MethodDescriptorProto::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &MethodDescriptorProto::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &MethodDescriptorProto::ByteSizeLong, &MethodDescriptorProto::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -8163,23 +8177,24 @@ inline void FileOptions::SharedCtor(::_pb::Arena* arena) { } FileOptions::~FileOptions() { // @@protoc_insertion_point(destructor:google.protobuf.FileOptions) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void FileOptions::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.java_package_.Destroy(); - _impl_.java_outer_classname_.Destroy(); - _impl_.go_package_.Destroy(); - _impl_.objc_class_prefix_.Destroy(); - _impl_.csharp_namespace_.Destroy(); - _impl_.swift_prefix_.Destroy(); - _impl_.php_class_prefix_.Destroy(); - _impl_.php_namespace_.Destroy(); - _impl_.php_metadata_namespace_.Destroy(); - _impl_.ruby_package_.Destroy(); - delete _impl_.features_; - _impl_.~Impl_(); + SharedDtor(*this); +} +inline void FileOptions::SharedDtor(MessageLite& self) { + FileOptions& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.java_package_.Destroy(); + this_._impl_.java_outer_classname_.Destroy(); + this_._impl_.go_package_.Destroy(); + this_._impl_.objc_class_prefix_.Destroy(); + this_._impl_.csharp_namespace_.Destroy(); + this_._impl_.swift_prefix_.Destroy(); + this_._impl_.php_class_prefix_.Destroy(); + this_._impl_.php_namespace_.Destroy(); + this_._impl_.php_metadata_namespace_.Destroy(); + this_._impl_.ruby_package_.Destroy(); + delete this_._impl_.features_; + this_._impl_.~Impl_(); } inline void* FileOptions::PlacementNew_(const void*, void* mem, @@ -8215,7 +8230,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &FileOptions::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &FileOptions::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &FileOptions::ByteSizeLong, &FileOptions::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -8998,13 +9013,14 @@ inline void MessageOptions::SharedCtor(::_pb::Arena* arena) { } MessageOptions::~MessageOptions() { // @@protoc_insertion_point(destructor:google.protobuf.MessageOptions) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void MessageOptions::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.features_; - _impl_.~Impl_(); +inline void MessageOptions::SharedDtor(MessageLite& self) { + MessageOptions& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.features_; + this_._impl_.~Impl_(); } inline void* MessageOptions::PlacementNew_(const void*, void* mem, @@ -9040,7 +9056,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &MessageOptions::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &MessageOptions::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &MessageOptions::ByteSizeLong, &MessageOptions::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -9423,13 +9439,14 @@ inline void FieldOptions_EditionDefault::SharedCtor(::_pb::Arena* arena) { } FieldOptions_EditionDefault::~FieldOptions_EditionDefault() { // @@protoc_insertion_point(destructor:google.protobuf.FieldOptions.EditionDefault) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void FieldOptions_EditionDefault::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.value_.Destroy(); - _impl_.~Impl_(); +inline void FieldOptions_EditionDefault::SharedDtor(MessageLite& self) { + FieldOptions_EditionDefault& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.value_.Destroy(); + this_._impl_.~Impl_(); } inline void* FieldOptions_EditionDefault::PlacementNew_(const void*, void* mem, @@ -9451,7 +9468,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &FieldOptions_EditionDefault::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &FieldOptions_EditionDefault::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &FieldOptions_EditionDefault::ByteSizeLong, &FieldOptions_EditionDefault::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -9705,13 +9722,14 @@ inline void FieldOptions_FeatureSupport::SharedCtor(::_pb::Arena* arena) { } FieldOptions_FeatureSupport::~FieldOptions_FeatureSupport() { // @@protoc_insertion_point(destructor:google.protobuf.FieldOptions.FeatureSupport) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void FieldOptions_FeatureSupport::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.deprecation_warning_.Destroy(); - _impl_.~Impl_(); +inline void FieldOptions_FeatureSupport::SharedDtor(MessageLite& self) { + FieldOptions_FeatureSupport& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.deprecation_warning_.Destroy(); + this_._impl_.~Impl_(); } inline void* FieldOptions_FeatureSupport::PlacementNew_(const void*, void* mem, @@ -9733,7 +9751,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &FieldOptions_FeatureSupport::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &FieldOptions_FeatureSupport::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &FieldOptions_FeatureSupport::ByteSizeLong, &FieldOptions_FeatureSupport::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -10054,14 +10072,15 @@ inline void FieldOptions::SharedCtor(::_pb::Arena* arena) { } FieldOptions::~FieldOptions() { // @@protoc_insertion_point(destructor:google.protobuf.FieldOptions) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void FieldOptions::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.features_; - delete _impl_.feature_support_; - _impl_.~Impl_(); +inline void FieldOptions::SharedDtor(MessageLite& self) { + FieldOptions& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.features_; + delete this_._impl_.feature_support_; + this_._impl_.~Impl_(); } inline void* FieldOptions::PlacementNew_(const void*, void* mem, @@ -10105,7 +10124,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &FieldOptions::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &FieldOptions::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &FieldOptions::ByteSizeLong, &FieldOptions::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -10675,13 +10694,14 @@ inline void OneofOptions::SharedCtor(::_pb::Arena* arena) { } OneofOptions::~OneofOptions() { // @@protoc_insertion_point(destructor:google.protobuf.OneofOptions) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void OneofOptions::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.features_; - _impl_.~Impl_(); +inline void OneofOptions::SharedDtor(MessageLite& self) { + OneofOptions& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.features_; + this_._impl_.~Impl_(); } inline void* OneofOptions::PlacementNew_(const void*, void* mem, @@ -10717,7 +10737,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &OneofOptions::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &OneofOptions::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &OneofOptions::ByteSizeLong, &OneofOptions::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -11011,13 +11031,14 @@ inline void EnumOptions::SharedCtor(::_pb::Arena* arena) { } EnumOptions::~EnumOptions() { // @@protoc_insertion_point(destructor:google.protobuf.EnumOptions) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void EnumOptions::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.features_; - _impl_.~Impl_(); +inline void EnumOptions::SharedDtor(MessageLite& self) { + EnumOptions& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.features_; + this_._impl_.~Impl_(); } inline void* EnumOptions::PlacementNew_(const void*, void* mem, @@ -11053,7 +11074,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &EnumOptions::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &EnumOptions::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &EnumOptions::ByteSizeLong, &EnumOptions::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -11419,14 +11440,15 @@ inline void EnumValueOptions::SharedCtor(::_pb::Arena* arena) { } EnumValueOptions::~EnumValueOptions() { // @@protoc_insertion_point(destructor:google.protobuf.EnumValueOptions) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void EnumValueOptions::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.features_; - delete _impl_.feature_support_; - _impl_.~Impl_(); +inline void EnumValueOptions::SharedDtor(MessageLite& self) { + EnumValueOptions& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.features_; + delete this_._impl_.feature_support_; + this_._impl_.~Impl_(); } inline void* EnumValueOptions::PlacementNew_(const void*, void* mem, @@ -11462,7 +11484,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &EnumValueOptions::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &EnumValueOptions::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &EnumValueOptions::ByteSizeLong, &EnumValueOptions::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -11835,13 +11857,14 @@ inline void ServiceOptions::SharedCtor(::_pb::Arena* arena) { } ServiceOptions::~ServiceOptions() { // @@protoc_insertion_point(destructor:google.protobuf.ServiceOptions) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void ServiceOptions::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.features_; - _impl_.~Impl_(); +inline void ServiceOptions::SharedDtor(MessageLite& self) { + ServiceOptions& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.features_; + this_._impl_.~Impl_(); } inline void* ServiceOptions::PlacementNew_(const void*, void* mem, @@ -11877,7 +11900,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &ServiceOptions::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &ServiceOptions::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &ServiceOptions::ByteSizeLong, &ServiceOptions::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -12199,13 +12222,14 @@ inline void MethodOptions::SharedCtor(::_pb::Arena* arena) { } MethodOptions::~MethodOptions() { // @@protoc_insertion_point(destructor:google.protobuf.MethodOptions) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void MethodOptions::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.features_; - _impl_.~Impl_(); +inline void MethodOptions::SharedDtor(MessageLite& self) { + MethodOptions& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.features_; + this_._impl_.~Impl_(); } inline void* MethodOptions::PlacementNew_(const void*, void* mem, @@ -12241,7 +12265,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &MethodOptions::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &MethodOptions::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &MethodOptions::ByteSizeLong, &MethodOptions::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -12577,13 +12601,14 @@ inline void UninterpretedOption_NamePart::SharedCtor(::_pb::Arena* arena) { } UninterpretedOption_NamePart::~UninterpretedOption_NamePart() { // @@protoc_insertion_point(destructor:google.protobuf.UninterpretedOption.NamePart) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void UninterpretedOption_NamePart::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_part_.Destroy(); - _impl_.~Impl_(); +inline void UninterpretedOption_NamePart::SharedDtor(MessageLite& self) { + UninterpretedOption_NamePart& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_part_.Destroy(); + this_._impl_.~Impl_(); } inline void* UninterpretedOption_NamePart::PlacementNew_(const void*, void* mem, @@ -12605,7 +12630,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &UninterpretedOption_NamePart::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &UninterpretedOption_NamePart::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &UninterpretedOption_NamePart::ByteSizeLong, &UninterpretedOption_NamePart::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -12872,15 +12897,16 @@ inline void UninterpretedOption::SharedCtor(::_pb::Arena* arena) { } UninterpretedOption::~UninterpretedOption() { // @@protoc_insertion_point(destructor:google.protobuf.UninterpretedOption) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void UninterpretedOption::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.identifier_value_.Destroy(); - _impl_.string_value_.Destroy(); - _impl_.aggregate_value_.Destroy(); - _impl_.~Impl_(); +inline void UninterpretedOption::SharedDtor(MessageLite& self) { + UninterpretedOption& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.identifier_value_.Destroy(); + this_._impl_.string_value_.Destroy(); + this_._impl_.aggregate_value_.Destroy(); + this_._impl_.~Impl_(); } inline void* UninterpretedOption::PlacementNew_(const void*, void* mem, @@ -12913,7 +12939,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &UninterpretedOption::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &UninterpretedOption::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &UninterpretedOption::ByteSizeLong, &UninterpretedOption::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -13309,12 +13335,13 @@ inline void FeatureSet::SharedCtor(::_pb::Arena* arena) { } FeatureSet::~FeatureSet() { // @@protoc_insertion_point(destructor:google.protobuf.FeatureSet) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void FeatureSet::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); +inline void FeatureSet::SharedDtor(MessageLite& self) { + FeatureSet& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); } inline void* FeatureSet::PlacementNew_(const void*, void* mem, @@ -13346,7 +13373,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &FeatureSet::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &FeatureSet::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &FeatureSet::ByteSizeLong, &FeatureSet::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -13705,14 +13732,15 @@ inline void FeatureSetDefaults_FeatureSetEditionDefault::SharedCtor(::_pb::Arena } FeatureSetDefaults_FeatureSetEditionDefault::~FeatureSetDefaults_FeatureSetEditionDefault() { // @@protoc_insertion_point(destructor:google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void FeatureSetDefaults_FeatureSetEditionDefault::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.overridable_features_; - delete _impl_.fixed_features_; - _impl_.~Impl_(); +inline void FeatureSetDefaults_FeatureSetEditionDefault::SharedDtor(MessageLite& self) { + FeatureSetDefaults_FeatureSetEditionDefault& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.overridable_features_; + delete this_._impl_.fixed_features_; + this_._impl_.~Impl_(); } inline void* FeatureSetDefaults_FeatureSetEditionDefault::PlacementNew_(const void*, void* mem, @@ -13734,7 +13762,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &FeatureSetDefaults_FeatureSetEditionDefault::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &FeatureSetDefaults_FeatureSetEditionDefault::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &FeatureSetDefaults_FeatureSetEditionDefault::ByteSizeLong, &FeatureSetDefaults_FeatureSetEditionDefault::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -14041,12 +14069,13 @@ inline void FeatureSetDefaults::SharedCtor(::_pb::Arena* arena) { } FeatureSetDefaults::~FeatureSetDefaults() { // @@protoc_insertion_point(destructor:google.protobuf.FeatureSetDefaults) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void FeatureSetDefaults::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); +inline void FeatureSetDefaults::SharedDtor(MessageLite& self) { + FeatureSetDefaults& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); } inline void* FeatureSetDefaults::PlacementNew_(const void*, void* mem, @@ -14079,7 +14108,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &FeatureSetDefaults::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &FeatureSetDefaults::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &FeatureSetDefaults::ByteSizeLong, &FeatureSetDefaults::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -14367,14 +14396,15 @@ inline void SourceCodeInfo_Location::SharedCtor(::_pb::Arena* arena) { } SourceCodeInfo_Location::~SourceCodeInfo_Location() { // @@protoc_insertion_point(destructor:google.protobuf.SourceCodeInfo.Location) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void SourceCodeInfo_Location::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.leading_comments_.Destroy(); - _impl_.trailing_comments_.Destroy(); - _impl_.~Impl_(); +inline void SourceCodeInfo_Location::SharedDtor(MessageLite& self) { + SourceCodeInfo_Location& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.leading_comments_.Destroy(); + this_._impl_.trailing_comments_.Destroy(); + this_._impl_.~Impl_(); } inline void* SourceCodeInfo_Location::PlacementNew_(const void*, void* mem, @@ -14415,7 +14445,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &SourceCodeInfo_Location::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &SourceCodeInfo_Location::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &SourceCodeInfo_Location::ByteSizeLong, &SourceCodeInfo_Location::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -14739,12 +14769,13 @@ inline void SourceCodeInfo::SharedCtor(::_pb::Arena* arena) { } SourceCodeInfo::~SourceCodeInfo() { // @@protoc_insertion_point(destructor:google.protobuf.SourceCodeInfo) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void SourceCodeInfo::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); +inline void SourceCodeInfo::SharedDtor(MessageLite& self) { + SourceCodeInfo& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); } inline void* SourceCodeInfo::PlacementNew_(const void*, void* mem, @@ -14777,7 +14808,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &SourceCodeInfo::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &SourceCodeInfo::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &SourceCodeInfo::ByteSizeLong, &SourceCodeInfo::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -15000,13 +15031,14 @@ inline void GeneratedCodeInfo_Annotation::SharedCtor(::_pb::Arena* arena) { } GeneratedCodeInfo_Annotation::~GeneratedCodeInfo_Annotation() { // @@protoc_insertion_point(destructor:google.protobuf.GeneratedCodeInfo.Annotation) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void GeneratedCodeInfo_Annotation::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.source_file_.Destroy(); - _impl_.~Impl_(); +inline void GeneratedCodeInfo_Annotation::SharedDtor(MessageLite& self) { + GeneratedCodeInfo_Annotation& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.source_file_.Destroy(); + this_._impl_.~Impl_(); } inline void* GeneratedCodeInfo_Annotation::PlacementNew_(const void*, void* mem, @@ -15039,7 +15071,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &GeneratedCodeInfo_Annotation::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &GeneratedCodeInfo_Annotation::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &GeneratedCodeInfo_Annotation::ByteSizeLong, &GeneratedCodeInfo_Annotation::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE @@ -15356,12 +15388,13 @@ inline void GeneratedCodeInfo::SharedCtor(::_pb::Arena* arena) { } GeneratedCodeInfo::~GeneratedCodeInfo() { // @@protoc_insertion_point(destructor:google.protobuf.GeneratedCodeInfo) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); + SharedDtor(*this); } -inline void GeneratedCodeInfo::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); +inline void GeneratedCodeInfo::SharedDtor(MessageLite& self) { + GeneratedCodeInfo& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); } inline void* GeneratedCodeInfo::PlacementNew_(const void*, void* mem, @@ -15394,7 +15427,7 @@ const ::google::protobuf::MessageLite::ClassDataFull &GeneratedCodeInfo::MergeImpl, ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - ::google::protobuf::Message::GetDeleteImpl(), + &GeneratedCodeInfo::SharedDtor, ::google::protobuf::Message::GetClearImpl(), &GeneratedCodeInfo::ByteSizeLong, &GeneratedCodeInfo::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index 95ff6de36a..6a5b6a9e8c 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -708,6 +708,14 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final public: inline UninterpretedOption_NamePart() : UninterpretedOption_NamePart(nullptr) {} ~UninterpretedOption_NamePart() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(UninterpretedOption_NamePart* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(UninterpretedOption_NamePart)); + } +#endif + template explicit PROTOBUF_CONSTEXPR UninterpretedOption_NamePart( ::google::protobuf::internal::ConstantInitialized); @@ -819,7 +827,7 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(UninterpretedOption_NamePart* other); private: template @@ -918,6 +926,14 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final public: inline SourceCodeInfo_Location() : SourceCodeInfo_Location(nullptr) {} ~SourceCodeInfo_Location() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(SourceCodeInfo_Location* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(SourceCodeInfo_Location)); + } +#endif + template explicit PROTOBUF_CONSTEXPR SourceCodeInfo_Location( ::google::protobuf::internal::ConstantInitialized); @@ -1024,7 +1040,7 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(SourceCodeInfo_Location* other); private: template @@ -1195,6 +1211,14 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final public: inline GeneratedCodeInfo_Annotation() : GeneratedCodeInfo_Annotation(nullptr) {} ~GeneratedCodeInfo_Annotation() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(GeneratedCodeInfo_Annotation* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(GeneratedCodeInfo_Annotation)); + } +#endif + template explicit PROTOBUF_CONSTEXPR GeneratedCodeInfo_Annotation( ::google::protobuf::internal::ConstantInitialized); @@ -1301,7 +1325,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(GeneratedCodeInfo_Annotation* other); private: template @@ -1467,6 +1491,14 @@ class PROTOBUF_EXPORT FieldOptions_FeatureSupport final public: inline FieldOptions_FeatureSupport() : FieldOptions_FeatureSupport(nullptr) {} ~FieldOptions_FeatureSupport() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(FieldOptions_FeatureSupport* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(FieldOptions_FeatureSupport)); + } +#endif + template explicit PROTOBUF_CONSTEXPR FieldOptions_FeatureSupport( ::google::protobuf::internal::ConstantInitialized); @@ -1573,7 +1605,7 @@ class PROTOBUF_EXPORT FieldOptions_FeatureSupport final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(FieldOptions_FeatureSupport* other); private: template @@ -1698,6 +1730,14 @@ class PROTOBUF_EXPORT FieldOptions_EditionDefault final public: inline FieldOptions_EditionDefault() : FieldOptions_EditionDefault(nullptr) {} ~FieldOptions_EditionDefault() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(FieldOptions_EditionDefault* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(FieldOptions_EditionDefault)); + } +#endif + template explicit PROTOBUF_CONSTEXPR FieldOptions_EditionDefault( ::google::protobuf::internal::ConstantInitialized); @@ -1804,7 +1844,7 @@ class PROTOBUF_EXPORT FieldOptions_EditionDefault final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(FieldOptions_EditionDefault* other); private: template @@ -1903,6 +1943,14 @@ class PROTOBUF_EXPORT FeatureSet final public: inline FeatureSet() : FeatureSet(nullptr) {} ~FeatureSet() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(FeatureSet* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(FeatureSet)); + } +#endif + template explicit PROTOBUF_CONSTEXPR FeatureSet( ::google::protobuf::internal::ConstantInitialized); @@ -2014,7 +2062,7 @@ class PROTOBUF_EXPORT FeatureSet final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(FeatureSet* other); private: template @@ -2460,6 +2508,14 @@ class PROTOBUF_EXPORT ExtensionRangeOptions_Declaration final public: inline ExtensionRangeOptions_Declaration() : ExtensionRangeOptions_Declaration(nullptr) {} ~ExtensionRangeOptions_Declaration() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ExtensionRangeOptions_Declaration* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ExtensionRangeOptions_Declaration)); + } +#endif + template explicit PROTOBUF_CONSTEXPR ExtensionRangeOptions_Declaration( ::google::protobuf::internal::ConstantInitialized); @@ -2566,7 +2622,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions_Declaration final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(ExtensionRangeOptions_Declaration* other); private: template @@ -2710,6 +2766,14 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final public: inline EnumDescriptorProto_EnumReservedRange() : EnumDescriptorProto_EnumReservedRange(nullptr) {} ~EnumDescriptorProto_EnumReservedRange() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(EnumDescriptorProto_EnumReservedRange* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(EnumDescriptorProto_EnumReservedRange)); + } +#endif + template explicit PROTOBUF_CONSTEXPR EnumDescriptorProto_EnumReservedRange( ::google::protobuf::internal::ConstantInitialized); @@ -2816,7 +2880,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(EnumDescriptorProto_EnumReservedRange* other); private: template @@ -2909,6 +2973,14 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final public: inline DescriptorProto_ReservedRange() : DescriptorProto_ReservedRange(nullptr) {} ~DescriptorProto_ReservedRange() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(DescriptorProto_ReservedRange* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(DescriptorProto_ReservedRange)); + } +#endif + template explicit PROTOBUF_CONSTEXPR DescriptorProto_ReservedRange( ::google::protobuf::internal::ConstantInitialized); @@ -3015,7 +3087,7 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(DescriptorProto_ReservedRange* other); private: template @@ -3108,6 +3180,14 @@ class PROTOBUF_EXPORT UninterpretedOption final public: inline UninterpretedOption() : UninterpretedOption(nullptr) {} ~UninterpretedOption() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(UninterpretedOption* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(UninterpretedOption)); + } +#endif + template explicit PROTOBUF_CONSTEXPR UninterpretedOption( ::google::protobuf::internal::ConstantInitialized); @@ -3219,7 +3299,7 @@ class PROTOBUF_EXPORT UninterpretedOption final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(UninterpretedOption* other); private: template @@ -3402,6 +3482,14 @@ class PROTOBUF_EXPORT SourceCodeInfo final public: inline SourceCodeInfo() : SourceCodeInfo(nullptr) {} ~SourceCodeInfo() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(SourceCodeInfo* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(SourceCodeInfo)); + } +#endif + template explicit PROTOBUF_CONSTEXPR SourceCodeInfo( ::google::protobuf::internal::ConstantInitialized); @@ -3508,7 +3596,7 @@ class PROTOBUF_EXPORT SourceCodeInfo final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(SourceCodeInfo* other); private: template @@ -3594,6 +3682,14 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final public: inline GeneratedCodeInfo() : GeneratedCodeInfo(nullptr) {} ~GeneratedCodeInfo() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(GeneratedCodeInfo* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(GeneratedCodeInfo)); + } +#endif + template explicit PROTOBUF_CONSTEXPR GeneratedCodeInfo( ::google::protobuf::internal::ConstantInitialized); @@ -3700,7 +3796,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(GeneratedCodeInfo* other); private: template @@ -3786,6 +3882,14 @@ class PROTOBUF_EXPORT FeatureSetDefaults_FeatureSetEditionDefault final public: inline FeatureSetDefaults_FeatureSetEditionDefault() : FeatureSetDefaults_FeatureSetEditionDefault(nullptr) {} ~FeatureSetDefaults_FeatureSetEditionDefault() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(FeatureSetDefaults_FeatureSetEditionDefault* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(FeatureSetDefaults_FeatureSetEditionDefault)); + } +#endif + template explicit PROTOBUF_CONSTEXPR FeatureSetDefaults_FeatureSetEditionDefault( ::google::protobuf::internal::ConstantInitialized); @@ -3897,7 +4001,7 @@ class PROTOBUF_EXPORT FeatureSetDefaults_FeatureSetEditionDefault final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(FeatureSetDefaults_FeatureSetEditionDefault* other); private: template @@ -4011,6 +4115,14 @@ class PROTOBUF_EXPORT ServiceOptions final public: inline ServiceOptions() : ServiceOptions(nullptr) {} ~ServiceOptions() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ServiceOptions* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ServiceOptions)); + } +#endif + template explicit PROTOBUF_CONSTEXPR ServiceOptions( ::google::protobuf::internal::ConstantInitialized); @@ -4122,7 +4234,7 @@ class PROTOBUF_EXPORT ServiceOptions final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(ServiceOptions* other); private: template @@ -4418,6 +4530,14 @@ class PROTOBUF_EXPORT OneofOptions final public: inline OneofOptions() : OneofOptions(nullptr) {} ~OneofOptions() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(OneofOptions* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(OneofOptions)); + } +#endif + template explicit PROTOBUF_CONSTEXPR OneofOptions( ::google::protobuf::internal::ConstantInitialized); @@ -4529,7 +4649,7 @@ class PROTOBUF_EXPORT OneofOptions final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(OneofOptions* other); private: template @@ -4812,6 +4932,14 @@ class PROTOBUF_EXPORT MethodOptions final public: inline MethodOptions() : MethodOptions(nullptr) {} ~MethodOptions() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(MethodOptions* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(MethodOptions)); + } +#endif + template explicit PROTOBUF_CONSTEXPR MethodOptions( ::google::protobuf::internal::ConstantInitialized); @@ -4923,7 +5051,7 @@ class PROTOBUF_EXPORT MethodOptions final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(MethodOptions* other); private: template @@ -5252,6 +5380,14 @@ class PROTOBUF_EXPORT MessageOptions final public: inline MessageOptions() : MessageOptions(nullptr) {} ~MessageOptions() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(MessageOptions* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(MessageOptions)); + } +#endif + template explicit PROTOBUF_CONSTEXPR MessageOptions( ::google::protobuf::internal::ConstantInitialized); @@ -5363,7 +5499,7 @@ class PROTOBUF_EXPORT MessageOptions final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(MessageOptions* other); private: template @@ -5711,6 +5847,14 @@ class PROTOBUF_EXPORT FileOptions final public: inline FileOptions() : FileOptions(nullptr) {} ~FileOptions() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(FileOptions* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(FileOptions)); + } +#endif + template explicit PROTOBUF_CONSTEXPR FileOptions( ::google::protobuf::internal::ConstantInitialized); @@ -5822,7 +5966,7 @@ class PROTOBUF_EXPORT FileOptions final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(FileOptions* other); private: template @@ -6432,6 +6576,14 @@ class PROTOBUF_EXPORT FieldOptions final public: inline FieldOptions() : FieldOptions(nullptr) {} ~FieldOptions() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(FieldOptions* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(FieldOptions)); + } +#endif + template explicit PROTOBUF_CONSTEXPR FieldOptions( ::google::protobuf::internal::ConstantInitialized); @@ -6543,7 +6695,7 @@ class PROTOBUF_EXPORT FieldOptions final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(FieldOptions* other); private: template @@ -7089,6 +7241,14 @@ class PROTOBUF_EXPORT FeatureSetDefaults final public: inline FeatureSetDefaults() : FeatureSetDefaults(nullptr) {} ~FeatureSetDefaults() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(FeatureSetDefaults* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(FeatureSetDefaults)); + } +#endif + template explicit PROTOBUF_CONSTEXPR FeatureSetDefaults( ::google::protobuf::internal::ConstantInitialized); @@ -7200,7 +7360,7 @@ class PROTOBUF_EXPORT FeatureSetDefaults final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(FeatureSetDefaults* other); private: template @@ -7313,6 +7473,14 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final public: inline ExtensionRangeOptions() : ExtensionRangeOptions(nullptr) {} ~ExtensionRangeOptions() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ExtensionRangeOptions* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ExtensionRangeOptions)); + } +#endif + template explicit PROTOBUF_CONSTEXPR ExtensionRangeOptions( ::google::protobuf::internal::ConstantInitialized); @@ -7424,7 +7592,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(ExtensionRangeOptions* other); private: template @@ -7759,6 +7927,14 @@ class PROTOBUF_EXPORT EnumValueOptions final public: inline EnumValueOptions() : EnumValueOptions(nullptr) {} ~EnumValueOptions() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(EnumValueOptions* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(EnumValueOptions)); + } +#endif + template explicit PROTOBUF_CONSTEXPR EnumValueOptions( ::google::protobuf::internal::ConstantInitialized); @@ -7870,7 +8046,7 @@ class PROTOBUF_EXPORT EnumValueOptions final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(EnumValueOptions* other); private: template @@ -8196,6 +8372,14 @@ class PROTOBUF_EXPORT EnumOptions final public: inline EnumOptions() : EnumOptions(nullptr) {} ~EnumOptions() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(EnumOptions* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(EnumOptions)); + } +#endif + template explicit PROTOBUF_CONSTEXPR EnumOptions( ::google::protobuf::internal::ConstantInitialized); @@ -8307,7 +8491,7 @@ class PROTOBUF_EXPORT EnumOptions final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(EnumOptions* other); private: template @@ -8629,6 +8813,14 @@ class PROTOBUF_EXPORT OneofDescriptorProto final public: inline OneofDescriptorProto() : OneofDescriptorProto(nullptr) {} ~OneofDescriptorProto() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(OneofDescriptorProto* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(OneofDescriptorProto)); + } +#endif + template explicit PROTOBUF_CONSTEXPR OneofDescriptorProto( ::google::protobuf::internal::ConstantInitialized); @@ -8740,7 +8932,7 @@ class PROTOBUF_EXPORT OneofDescriptorProto final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(OneofDescriptorProto* other); private: template @@ -8843,6 +9035,14 @@ class PROTOBUF_EXPORT MethodDescriptorProto final public: inline MethodDescriptorProto() : MethodDescriptorProto(nullptr) {} ~MethodDescriptorProto() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(MethodDescriptorProto* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(MethodDescriptorProto)); + } +#endif + template explicit PROTOBUF_CONSTEXPR MethodDescriptorProto( ::google::protobuf::internal::ConstantInitialized); @@ -8954,7 +9154,7 @@ class PROTOBUF_EXPORT MethodDescriptorProto final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(MethodDescriptorProto* other); private: template @@ -9121,6 +9321,14 @@ class PROTOBUF_EXPORT FieldDescriptorProto final public: inline FieldDescriptorProto() : FieldDescriptorProto(nullptr) {} ~FieldDescriptorProto() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(FieldDescriptorProto* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(FieldDescriptorProto)); + } +#endif + template explicit PROTOBUF_CONSTEXPR FieldDescriptorProto( ::google::protobuf::internal::ConstantInitialized); @@ -9232,7 +9440,7 @@ class PROTOBUF_EXPORT FieldDescriptorProto final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(FieldDescriptorProto* other); private: template @@ -9531,6 +9739,14 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final public: inline EnumValueDescriptorProto() : EnumValueDescriptorProto(nullptr) {} ~EnumValueDescriptorProto() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(EnumValueDescriptorProto* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(EnumValueDescriptorProto)); + } +#endif + template explicit PROTOBUF_CONSTEXPR EnumValueDescriptorProto( ::google::protobuf::internal::ConstantInitialized); @@ -9642,7 +9858,7 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(EnumValueDescriptorProto* other); private: template @@ -9758,6 +9974,14 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final public: inline DescriptorProto_ExtensionRange() : DescriptorProto_ExtensionRange(nullptr) {} ~DescriptorProto_ExtensionRange() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(DescriptorProto_ExtensionRange* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(DescriptorProto_ExtensionRange)); + } +#endif + template explicit PROTOBUF_CONSTEXPR DescriptorProto_ExtensionRange( ::google::protobuf::internal::ConstantInitialized); @@ -9869,7 +10093,7 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(DescriptorProto_ExtensionRange* other); private: template @@ -9979,6 +10203,14 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final public: inline ServiceDescriptorProto() : ServiceDescriptorProto(nullptr) {} ~ServiceDescriptorProto() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ServiceDescriptorProto* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ServiceDescriptorProto)); + } +#endif + template explicit PROTOBUF_CONSTEXPR ServiceDescriptorProto( ::google::protobuf::internal::ConstantInitialized); @@ -10090,7 +10322,7 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(ServiceDescriptorProto* other); private: template @@ -10212,6 +10444,14 @@ class PROTOBUF_EXPORT EnumDescriptorProto final public: inline EnumDescriptorProto() : EnumDescriptorProto(nullptr) {} ~EnumDescriptorProto() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(EnumDescriptorProto* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(EnumDescriptorProto)); + } +#endif + template explicit PROTOBUF_CONSTEXPR EnumDescriptorProto( ::google::protobuf::internal::ConstantInitialized); @@ -10323,7 +10563,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(EnumDescriptorProto* other); private: template @@ -10489,6 +10729,14 @@ class PROTOBUF_EXPORT DescriptorProto final public: inline DescriptorProto() : DescriptorProto(nullptr) {} ~DescriptorProto() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(DescriptorProto* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(DescriptorProto)); + } +#endif + template explicit PROTOBUF_CONSTEXPR DescriptorProto( ::google::protobuf::internal::ConstantInitialized); @@ -10600,7 +10848,7 @@ class PROTOBUF_EXPORT DescriptorProto final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(DescriptorProto* other); private: template @@ -10862,6 +11110,14 @@ class PROTOBUF_EXPORT FileDescriptorProto final public: inline FileDescriptorProto() : FileDescriptorProto(nullptr) {} ~FileDescriptorProto() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(FileDescriptorProto* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(FileDescriptorProto)); + } +#endif + template explicit PROTOBUF_CONSTEXPR FileDescriptorProto( ::google::protobuf::internal::ConstantInitialized); @@ -10973,7 +11229,7 @@ class PROTOBUF_EXPORT FileDescriptorProto final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(FileDescriptorProto* other); private: template @@ -11284,6 +11540,14 @@ class PROTOBUF_EXPORT FileDescriptorSet final public: inline FileDescriptorSet() : FileDescriptorSet(nullptr) {} ~FileDescriptorSet() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(FileDescriptorSet* msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(FileDescriptorSet)); + } +#endif + template explicit PROTOBUF_CONSTEXPR FileDescriptorSet( ::google::protobuf::internal::ConstantInitialized); @@ -11395,7 +11659,7 @@ class PROTOBUF_EXPORT FileDescriptorSet final private: void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); + static void SharedDtor(MessageLite& self); void InternalSwap(FileDescriptorSet* other); private: template diff --git a/src/google/protobuf/dynamic_message.cc b/src/google/protobuf/dynamic_message.cc index 122c32f94c..1af6bc5d61 100644 --- a/src/google/protobuf/dynamic_message.cc +++ b/src/google/protobuf/dynamic_message.cc @@ -234,7 +234,7 @@ class DynamicMessage final : public Message { } static void* NewImpl(const void* prototype, void* mem, Arena* arena); - static void DeleteImpl(void* ptr, bool free_memory); + static void DestroyImpl(MessageLite& ptr); void* MutableRaw(int i); void* MutableExtensionsRaw(); @@ -269,7 +269,7 @@ struct DynamicMessageFactory::TypeInfo { &DynamicMessage::IsInitializedImpl, &DynamicMessage::MergeImpl, internal::MessageCreator(), // to be filled later - &DynamicMessage::DeleteImpl, + &DynamicMessage::DestroyImpl, static_cast(&DynamicMessage::ClearImpl), DynamicMessage::ByteSizeLongImpl, DynamicMessage::_InternalSerializeImpl, @@ -570,13 +570,8 @@ void* DynamicMessage::NewImpl(const void* prototype, void* mem, Arena* arena) { return new (mem) DynamicMessage(type_info, arena); } -void DynamicMessage::DeleteImpl(void* ptr, bool free_memory) { - auto* msg = static_cast(ptr); - const size_t size = msg->type_info_->class_data.allocation_size(); - msg->~DynamicMessage(); - if (free_memory) { - internal::SizedDelete(ptr, size); - } +void DynamicMessage::DestroyImpl(MessageLite& msg) { + static_cast(msg).~DynamicMessage(); } void DynamicMessage::CrossLinkPrototypes() { diff --git a/src/google/protobuf/generated_message_bases.cc b/src/google/protobuf/generated_message_bases.cc index 044e570990..37016bd4fa 100644 --- a/src/google/protobuf/generated_message_bases.cc +++ b/src/google/protobuf/generated_message_bases.cc @@ -37,6 +37,11 @@ ZeroFieldsBase::~ZeroFieldsBase() { _internal_metadata_.Delete(); } +void ZeroFieldsBase::SharedDtor(MessageLite& msg) { + static_cast(msg) + ._internal_metadata_.Delete(); +} + size_t ZeroFieldsBase::ByteSizeLong(const MessageLite& base) { auto& msg = static_cast(base); return msg.MaybeComputeUnknownFieldsSize(0, &msg._impl_._cached_size_); diff --git a/src/google/protobuf/generated_message_bases.h b/src/google/protobuf/generated_message_bases.h index 48d94db6c4..3adc381613 100644 --- a/src/google/protobuf/generated_message_bases.h +++ b/src/google/protobuf/generated_message_bases.h @@ -41,6 +41,7 @@ class PROTOBUF_EXPORT ZeroFieldsBase : public Message { using Message::Message; ~ZeroFieldsBase() PROTOBUF_OVERRIDE; + static void SharedDtor(MessageLite& msg); static void MergeImpl(MessageLite& to, const MessageLite& from); static void CopyImpl(Message& to, const Message& from); void InternalSwap(ZeroFieldsBase* other); diff --git a/src/google/protobuf/generated_message_tctable_lite.cc b/src/google/protobuf/generated_message_tctable_lite.cc index f2dc1334df..c9ac36390f 100644 --- a/src/google/protobuf/generated_message_tctable_lite.cc +++ b/src/google/protobuf/generated_message_tctable_lite.cc @@ -2543,7 +2543,7 @@ PROTOBUF_NOINLINE void TcParser::DestroyMapNode(NodeBase* node, ->~basic_string(); } else if (map_info.value_type_card.cpp_type() == MapTypeCard::kMessage) { static_cast(node->GetVoidValue(map_info.node_size_info)) - ->DestroyInstance(false); + ->DestroyInstance(); } map.DeallocNode(node, map_info.node_size_info); } diff --git a/src/google/protobuf/implicit_weak_message.cc b/src/google/protobuf/implicit_weak_message.cc index f80ef4ac9c..e9144be390 100644 --- a/src/google/protobuf/implicit_weak_message.cc +++ b/src/google/protobuf/implicit_weak_message.cc @@ -71,7 +71,7 @@ constexpr MessageLite::ClassDataLite<1> ImplicitWeakMessage::class_data_ = { MergeImpl, internal::MessageCreator(NewImpl, sizeof(ImplicitWeakMessage)), - GetDeleteImpl(), + &DestroyImpl, GetClearImpl(), &ByteSizeLongImpl, &_InternalSerializeImpl, diff --git a/src/google/protobuf/implicit_weak_message.h b/src/google/protobuf/implicit_weak_message.h index b3a801a294..2b9203d878 100644 --- a/src/google/protobuf/implicit_weak_message.h +++ b/src/google/protobuf/implicit_weak_message.h @@ -87,6 +87,9 @@ class PROTOBUF_EXPORT ImplicitWeakMessage final : public MessageLite { static void MergeImpl(MessageLite&, const MessageLite&); + static void DestroyImpl(MessageLite& msg) { + static_cast(msg).~ImplicitWeakMessage(); + } static size_t ByteSizeLongImpl(const MessageLite& msg) { return static_cast(msg).ByteSizeLong(); } diff --git a/src/google/protobuf/map.cc b/src/google/protobuf/map.cc index 97cf262ea2..db6784d8c9 100644 --- a/src/google/protobuf/map.cc +++ b/src/google/protobuf/map.cc @@ -162,14 +162,14 @@ void UntypedMapBase::ClearTable(const ClearInput input) { case kValueIsProto: loop([size_info = input.size_info](NodeBase* node) { static_cast(node->GetVoidValue(size_info)) - ->DestroyInstance(false); + ->DestroyInstance(); }); break; case kKeyIsString | kValueIsProto: loop([size_info = input.size_info](NodeBase* node) { static_cast(node->GetVoidKey())->~basic_string(); static_cast(node->GetVoidValue(size_info)) - ->DestroyInstance(false); + ->DestroyInstance(); }); break; case kUseDestructFunc: diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 39508b0470..4e44456273 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -1190,7 +1190,7 @@ class RustMapHelper { m->erase_no_destroy(bucket, static_cast(node)); } - static void DestroyMessage(MessageLite* m) { m->DestroyInstance(false); } + static void DestroyMessage(MessageLite* m) { m->DestroyInstance(); } static void ClearTable(UntypedMapBase* m, ClearInput input) { m->ClearTable(input); diff --git a/src/google/protobuf/map_entry.h b/src/google/protobuf/map_entry.h index c21d74332a..5a5d53b37b 100644 --- a/src/google/protobuf/map_entry.h +++ b/src/google/protobuf/map_entry.h @@ -85,9 +85,7 @@ class MapEntry : public Message { ~MapEntry() PROTOBUF_OVERRIDE { if (GetArena() != nullptr) return; - this->_internal_metadata_.template Delete(); - KeyTypeHandler::DeleteNoArena(_impl_.key_); - ValueTypeHandler::DeleteNoArena(_impl_.value_); + SharedDtor(*this); } using InternalArenaConstructable_ = void; @@ -98,6 +96,13 @@ class MapEntry : public Message { protected: friend class google::protobuf::Arena; + static void SharedDtor(MessageLite& msg) { + auto& this_ = static_cast(msg); + this_._internal_metadata_.template Delete(); + KeyTypeHandler::DeleteNoArena(this_._impl_.key_); + ValueTypeHandler::DeleteNoArena(this_._impl_.value_); + } + // Field naming follows the convention of generated messages to make code // sharing easier. struct { diff --git a/src/google/protobuf/message_lite.cc b/src/google/protobuf/message_lite.cc index 9b3debf11e..456b0b063e 100644 --- a/src/google/protobuf/message_lite.cc +++ b/src/google/protobuf/message_lite.cc @@ -45,15 +45,23 @@ namespace google { namespace protobuf { -void MessageLite::DestroyInstance(bool free_memory) { +void MessageLite::DestroyInstance() { #if defined(PROTOBUF_CUSTOM_VTABLE) - _class_data_->delete_message(this, free_memory); + _class_data_->destroy_message(*this); #else // PROTOBUF_CUSTOM_VTABLE - ABSL_DCHECK(!free_memory); this->~MessageLite(); #endif // PROTOBUF_CUSTOM_VTABLE } +void MessageLite::DeleteInstance() { + // Cache the size and pointer because we can't access them after the + // destruction. + const size_t size = GetClassData()->allocation_size(); + void* const ptr = this; + DestroyInstance(); + internal::SizedDelete(ptr, size); +} + void MessageLite::CheckTypeAndMergeFrom(const MessageLite& other) { auto* data = GetClassData(); auto* other_data = other.GetClassData(); diff --git a/src/google/protobuf/message_lite.h b/src/google/protobuf/message_lite.h index 4dc6278d2c..dc0137e064 100644 --- a/src/google/protobuf/message_lite.h +++ b/src/google/protobuf/message_lite.h @@ -162,7 +162,7 @@ class PROTOBUF_EXPORT CachedSize { } void Set(Scalar desired) const noexcept { - // Avoid writing the value when it is zero. This prevents writing to gloabl + // Avoid writing the value when it is zero. This prevents writing to global // default instances, which might be in readonly memory. if (ABSL_PREDICT_FALSE(desired == 0)) { if (Get() == 0) return; @@ -636,16 +636,6 @@ class PROTOBUF_EXPORT MessageLite { } #if defined(PROTOBUF_CUSTOM_VTABLE) - template - static void DeleteImpl(void* msg, bool free_memory) { - static_cast(msg)->~T(); - if (free_memory) internal::SizedDelete(msg, sizeof(T)); - } - template - static constexpr auto GetDeleteImpl() { - return DeleteImpl; - } - template static constexpr auto GetClearImpl() { return static_cast(&T::Clear); @@ -654,8 +644,6 @@ class PROTOBUF_EXPORT MessageLite { // When custom vtables are off we avoid instantiating the functions because we // will not use them anyway. Less work for the compiler. template - using GetDeleteImpl = std::nullptr_t; - template using GetClearImpl = std::nullptr_t; #endif // PROTOBUF_CUSTOM_VTABLE @@ -698,7 +686,7 @@ class PROTOBUF_EXPORT MessageLite { // otherwise be null. We can have some metadata in ClassData telling us if we // have them and their offset. friend internal::MessageCreator; - using DeleteMessageF = void (*)(void* msg, bool free_memory); + using DestroyMessageF = void (*)(MessageLite& msg); struct ClassData { const MessageLite* prototype; const internal::TcParseTableBase* tc_table; @@ -707,7 +695,7 @@ class PROTOBUF_EXPORT MessageLite { void (*merge_to_from)(MessageLite& to, const MessageLite& from_msg); internal::MessageCreator message_creator; #if defined(PROTOBUF_CUSTOM_VTABLE) - DeleteMessageF delete_message; + DestroyMessageF destroy_message; void (MessageLite::*clear)(); size_t (*byte_size_long)(const MessageLite&); uint8_t* (*serialize)(const MessageLite& msg, uint8_t* ptr, @@ -752,7 +740,7 @@ class PROTOBUF_EXPORT MessageLite { bool (*is_initialized)(const MessageLite&), void (*merge_to_from)(MessageLite& to, const MessageLite& from_msg), internal::MessageCreator message_creator, // - DeleteMessageF delete_message, // + DestroyMessageF destroy_message, // void (MessageLite::*clear)(), size_t (*byte_size_long)(const MessageLite&), uint8_t* (*serialize)(const MessageLite& msg, uint8_t* ptr, @@ -765,7 +753,7 @@ class PROTOBUF_EXPORT MessageLite { merge_to_from(merge_to_from), message_creator(message_creator), #if defined(PROTOBUF_CUSTOM_VTABLE) - delete_message(delete_message), + destroy_message(destroy_message), clear(clear), byte_size_long(byte_size_long), serialize(serialize), @@ -931,7 +919,7 @@ class PROTOBUF_EXPORT MessageLite { #if defined(PROTOBUF_CUSTOM_VTABLE) void operator delete(MessageLite* msg, std::destroying_delete_t) { - msg->DestroyInstance(true); + msg->DeleteInstance(); } #endif @@ -963,9 +951,11 @@ class PROTOBUF_EXPORT MessageLite { bool MergeFromImpl(io::CodedInputStream* input, ParseFlags parse_flags); - // Runs the destructor for this instance, and if `free_memory` is true, - // also frees the memory. - void DestroyInstance(bool free_memory); + // Runs the destructor for this instance. + void DestroyInstance(); + // Runs the destructor for this instance and deletes the memory via + // `operator delete` + void DeleteInstance(); template static constexpr auto GetStrongPointerForTypeImpl(int) {