summaryrefslogtreecommitdiff
path: root/src/upb_def.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-02-17 11:37:25 -0800
committerJoshua Haberman <joshua@reverberate.org>2011-02-17 11:37:25 -0800
commitf9a6f67e275dd6d379ae9428e1c40f43d8d17386 (patch)
tree143b444dd9b5c9f32771b0e910243aa5da3fc902 /src/upb_def.h
parent5edfe9a4c9badf0095f65c88611b107ee28dc9ad (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.h29
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.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback