summaryrefslogtreecommitdiff
path: root/src/upb.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-01-05 18:30:36 -0800
committerJoshua Haberman <joshua@reverberate.org>2010-01-05 18:30:36 -0800
commit5864888c6e7424af70d84802b55879f406d2d7b2 (patch)
tree3608dbcc1ef7f34542835221743c8fcbe9e3b128 /src/upb.h
parentd75197375876538332d6d81aa4e8edd13b8f26c1 (diff)
parent6a8dfa5f26500b90aa9ecab418abba98d1e4e356 (diff)
Merge branch 'data-refactoring'. Ported benchmarks.
Conflicts: src/upb_data.c src/upb_data.h
Diffstat (limited to 'src/upb.h')
-rw-r--r--src/upb.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/upb.h b/src/upb.h
index 2809418..2c0a23d 100644
--- a/src/upb.h
+++ b/src/upb.h
@@ -125,11 +125,10 @@ struct upb_tag {
// INTERNAL-ONLY: never refer to these types with a tag ("union", "struct").
// Always use the typedefs.
-union _upb_array;
struct _upb_msg;
-typedef union _upb_array upb_array;
typedef struct _upb_msg upb_msg;
+
typedef upb_atomic_refcount_t upb_data;
typedef uint32_t upb_strlen_t;
@@ -143,6 +142,15 @@ typedef union {
upb_data *base;
} upb_strptr;
+typedef uint32_t upb_arraylen_t;
+
+typedef union {
+ // Must be first, for the UPB_STATIC_ARRAY_PTR_INIT() macro.
+ struct upb_norefcount_array *norefcount;
+ struct upb_refcounted_array *refcounted;
+ upb_data *base;
+} upb_arrayptr;
+
// A single .proto value. The owner must have an out-of-band way of knowing
// the type, so that it knows which union member to use.
union upb_value {
@@ -154,7 +162,7 @@ union upb_value {
uint64_t uint64;
bool _bool;
upb_strptr str;
- upb_array *arr;
+ upb_arrayptr arr;
upb_msg *msg;
upb_data *data;
};
@@ -171,7 +179,7 @@ union upb_value_ptr {
uint64_t *uint64;
bool *_bool;
upb_strptr *str;
- upb_array **arr;
+ upb_arrayptr *arr;
upb_msg **msg;
upb_data **data;
void *_void;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback