From f9a6f67e275dd6d379ae9428e1c40f43d8d17386 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 17 Feb 2011 11:37:25 -0800 Subject: Track buffer end instead of buffer length, for a small perf improvement. --- src/upb_def.h | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src/upb_def.h') diff --git a/src/upb_def.h b/src/upb_def.h index 28cc258..6e4bc25 100644 --- a/src/upb_def.h +++ b/src/upb_def.h @@ -88,29 +88,26 @@ INLINE void upb_def_unref(upb_def *def) { // is either a field of a upb_msgdef or contained inside a upb_extensiondef. // It is also reference-counted. typedef struct _upb_fielddef { - upb_value default_value; + uint8_t type; + uint8_t label; + // True if we own a ref on "def" (above). This is true unless this edge is + // part of a cycle. + bool owned; + uint8_t set_bit_mask; - upb_string *name; + int32_t number; + int16_t field_index; // Indicates set bit. + uint16_t set_bit_offset; + uint32_t byte_offset; // Where in a upb_msg to find the data. + + upb_value default_value; + upb_string *name; struct _upb_msgdef *msgdef; // For the case of an enum or a submessage, points to the def for that type. upb_def *def; - upb_atomic_refcount_t refcount; - uint32_t byte_offset; // Where in a upb_msg to find the data. - - // These are set only when this fielddef is part of a msgdef. - upb_field_number_t number; - upb_field_count_t field_index; // Indicates set bit. - - upb_fieldtype_t type; - upb_label_t label; - // True if we own a ref on "def" (above). This is true unless this edge is - // part of a cycle. - bool owned; - uint8_t set_bit_mask; - uint16_t set_bit_offset; } upb_fielddef; // A variety of tests about the type of a field. -- cgit v1.2.3