mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
Remove tc_table from MessageInfo.
This reduces the size of ExtensionInfo. PiperOrigin-RevId: 968562757
This commit is contained in:
parent
035554bd86
commit
39882988a9
3 changed files with 2 additions and 15 deletions
|
|
@ -169,13 +169,8 @@ void ExtensionSet::RegisterMessageExtension(const MessageLite* extendee,
|
|||
ExtensionInfo info(extendee, number, type, is_repeated, is_packed,
|
||||
verify_func, is_lazy);
|
||||
info.message_info = {
|
||||
&internal::MessageGlobalsBase::FromDefaultInstance(prototype)->class_data,
|
||||
#if defined(PROTOBUF_CONSTINIT_DEFAULT_INSTANCES)
|
||||
prototype->GetTcParseTable()
|
||||
#else
|
||||
nullptr
|
||||
#endif
|
||||
};
|
||||
&internal::MessageGlobalsBase::FromDefaultInstance(prototype)
|
||||
->class_data};
|
||||
Register(info);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -165,13 +165,6 @@ struct ExtensionInfo {
|
|||
struct MessageInfo {
|
||||
// Never null.
|
||||
const internal::ClassData* class_data;
|
||||
// TODO: Remove `tc_table` now that we can easily get it from
|
||||
// `class_data`.
|
||||
// The TcParse table used for this object. Never null. (except in platforms
|
||||
// that don't constant initialize default instances)
|
||||
const internal::TcParseTableBase* tc_table = nullptr;
|
||||
|
||||
const internal::TcParseTableBase* GetTcTable() const { return tc_table; }
|
||||
};
|
||||
|
||||
union {
|
||||
|
|
|
|||
|
|
@ -262,7 +262,6 @@ bool DescriptorPoolExtensionFinder::Find(int number, ExtensionInfo* output) {
|
|||
<< extension->full_name();
|
||||
output->message_info.class_data =
|
||||
&MessageGlobalsBase::FromDefaultInstance(prototype)->class_data;
|
||||
output->message_info.tc_table = prototype->GetTcParseTable();
|
||||
|
||||
} else if (extension->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) {
|
||||
output->enum_validity_check.enum_data =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue