diff options
author | Joshua Haberman <joshua@reverberate.org> | 2010-01-05 18:30:36 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2010-01-05 18:30:36 -0800 |
commit | 5864888c6e7424af70d84802b55879f406d2d7b2 (patch) | |
tree | 3608dbcc1ef7f34542835221743c8fcbe9e3b128 /src/upb.h | |
parent | d75197375876538332d6d81aa4e8edd13b8f26c1 (diff) | |
parent | 6a8dfa5f26500b90aa9ecab418abba98d1e4e356 (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.h | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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; |