Remove tc_table from MessageInfo.

This reduces the size of ExtensionInfo.

PiperOrigin-RevId: 968562757
This commit is contained in:
Samuel Benzaquen 2026-08-21 10:12:19 -07:00 committed by Copybara-Service
parent 035554bd86
commit 39882988a9
3 changed files with 2 additions and 15 deletions

View file

@ -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);
}

View file

@ -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 {

View file

@ -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 =