Merge remote-tracking branch 'origin/devirtualize-proto-encode' into integration

This commit is contained in:
J. Nick Koston
2026-03-03 21:58:08 -10:00
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -468,7 +468,8 @@ class ProtoMessage {
virtual const char *message_name() const { return "unknown"; }
#endif
// Non-virtual: messages are never deleted polymorphically.
protected:
// Non-virtual destructor is protected to prevent polymorphic deletion.
~ProtoMessage() = default;
};
+3
View File
@@ -280,6 +280,9 @@ class TypeInfo(ABC):
"""
field_id_size = self.calculate_field_id_size()
method = f"calc_{base_method}_force" if force else f"calc_{base_method}"
# calc_bool_force only takes field_id_size (no value needed - bool is always 1 byte)
if base_method == "bool" and force:
return f"size += ProtoSize::{method}({field_id_size});"
value = value_expr or name
return f"size += ProtoSize::{method}({field_id_size}, {value});"