diff options
author | Joshua Haberman <joshua@reverberate.org> | 2011-02-17 11:37:25 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2011-02-17 11:37:25 -0800 |
commit | f9a6f67e275dd6d379ae9428e1c40f43d8d17386 (patch) | |
tree | 143b444dd9b5c9f32771b0e910243aa5da3fc902 /src/upb_def.h | |
parent | 5edfe9a4c9badf0095f65c88611b107ee28dc9ad (diff) |
Track buffer end instead of buffer length, for a small perf improvement.
Diffstat (limited to 'src/upb_def.h')
-rw-r--r-- | src/upb_def.h | 29 |
1 files changed, 13 insertions, 16 deletions
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. |