From a503b8859c37906ab5012db163daca43bfe393bb Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 21 May 2011 17:35:21 -0700 Subject: 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 --- src/upb_msg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/upb_msg.h') 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. }; -- cgit v1.2.3