From 2282d2489bd8db3cd4ddbe0dd813732bffcf6452 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 12 Aug 2009 13:47:24 -0700 Subject: Refactoring: unify upb_msg. The cost is that a upb_msg will now always have an overhead of 2*sizeof(void*). This is comparable to proto2 overhead. The benefit is that upb_msg is now self-describing, and read-only algorithms can now operate on a upb_msg regardless of the memory-management scheme. Also, upb_array and upb_string now know inherently if they own their associated memory, and upb_array has a generic pointer for memory management purposes like upb_msg does. --- src/upb_text.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/upb_text.h') diff --git a/src/upb_text.h b/src/upb_text.h index f35f8d8..32d7278 100644 --- a/src/upb_text.h +++ b/src/upb_text.h @@ -23,10 +23,10 @@ INLINE void upb_text_printer_init(struct upb_text_printer *p, bool single_line) p->single_line = single_line; } void upb_text_printval(upb_field_type_t type, union upb_value p, FILE *file); -void upb_text_printfield(struct upb_text_printer *p, struct upb_string name, +void upb_text_printfield(struct upb_text_printer *p, struct upb_string *name, upb_field_type_t valtype, union upb_value val, FILE *stream); -void upb_text_push(struct upb_text_printer *p, struct upb_string submsg_type, +void upb_text_push(struct upb_text_printer *p, struct upb_string *submsg_type, FILE *stream); void upb_text_pop(struct upb_text_printer *p, FILE *stream); -- cgit v1.2.3