summaryrefslogtreecommitdiff
path: root/src/upb_struct.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/upb_struct.h')
-rw-r--r--src/upb_struct.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/upb_struct.h b/src/upb_struct.h
index 9c1bb2e..c83978f 100644
--- a/src/upb_struct.h
+++ b/src/upb_struct.h
@@ -29,6 +29,10 @@ INLINE bool upb_mmhead_norefs(struct upb_mmhead *head) {
return head->refcount == 0 && head->refs == NULL;
}
+INLINE bool upb_mmhead_only(struct upb_mmhead *head) {
+ return head->refcount == 1 && head->refs == NULL;
+}
+
INLINE bool upb_mmhead_unref(struct upb_mmhead *head) {
head->refcount--;
return upb_mmhead_norefs(head);
@@ -57,7 +61,7 @@ struct upb_array {
struct upb_msg_fielddef *fielddef; /* Defines the type of the array. */
union upb_value_ptr elements;
upb_arraylen_t len; /* Number of elements in "elements". */
- upb_arraylen_t size; /* Memory we own (0 if by reference). */
+ upb_arraylen_t size; /* Memory we own. */
};
struct upb_string {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback