diff options
author | Joshua Haberman <joshua@reverberate.org> | 2011-05-21 17:35:21 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2011-05-21 17:35:21 -0700 |
commit | a503b8859c37906ab5012db163daca43bfe393bb (patch) | |
tree | babc144389856dbe29bacb48bdbe267b9a48e5b8 /src/upb_msg.h | |
parent | 2ccebb74c309c7ea4c4589b35893cdd6c996ac4b (diff) |
Make all handlers objects refcounted.
I'm realizing that basically all upb objects
will need to be refcounted to be sharable
across languages, but *not* messages which
are on their way out so we can get out of
the business of data representations.
Things which must be refcounted:
- encoders, decoders
- handlers objects
- defs
Diffstat (limited to 'src/upb_msg.h')
-rw-r--r-- | src/upb_msg.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/upb_msg.h b/src/upb_msg.h index ac113a8..4e1b4d5 100644 --- a/src/upb_msg.h +++ b/src/upb_msg.h @@ -142,7 +142,7 @@ INLINE void upb_value_write(upb_valueptr ptr, upb_value val, typedef uint32_t upb_arraylen_t; struct _upb_array { - upb_atomic_refcount_t refcount; + upb_atomic_t refcount; // "len" and "size" are measured in elements, not bytes. int32_t len; int32_t size; @@ -192,7 +192,7 @@ INLINE upb_value upb_array_get(upb_array *arr, upb_fielddef *f, // 2. you would want the msg to own a ref on its msgdef, but this would require // an atomic operation for every message create or destroy! struct _upb_msg { - upb_atomic_refcount_t refcount; + upb_atomic_t refcount; uint8_t data[4]; // We allocate the appropriate amount per message. }; |