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_def.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/upb_def.h') diff --git a/src/upb_def.h b/src/upb_def.h index c2509ec..776231a 100644 --- a/src/upb_def.h +++ b/src/upb_def.h @@ -56,7 +56,7 @@ typedef int8_t upb_deftype_t; typedef struct { upb_string *fqname; // Fully qualified. - upb_atomic_refcount_t refcount; + upb_atomic_t refcount; upb_deftype_t type; // The is_cyclic flag could go in upb_msgdef instead of here, because only @@ -110,7 +110,7 @@ struct _upb_fielddef { // For the case of an enum or a submessage, points to the def for that type. upb_def *def; - upb_atomic_refcount_t refcount; + upb_atomic_t refcount; }; // A variety of tests about the type of a field. @@ -159,7 +159,7 @@ INLINE bool upb_elem_ismm(upb_fielddef *f) { // Structure that describes a single .proto message type. typedef struct _upb_msgdef { upb_def base; - upb_atomic_refcount_t cycle_refcount; + upb_atomic_t cycle_refcount; uint32_t size; uint32_t set_flags_bytes; @@ -283,7 +283,7 @@ INLINE int32_t upb_enum_iter_number(upb_enum_iter iter) { // Clients add definitions to the symtab by supplying descriptors (as defined // in descriptor.proto) via the upb_stream interface. struct _upb_symtab { - upb_atomic_refcount_t refcount; + upb_atomic_t refcount; upb_rwlock_t lock; // Protects all members except the refcount. upb_strtable symtab; // The symbol table. upb_msgdef *fds_msgdef; // Msgdef for google.protobuf.FileDescriptorSet. -- cgit v1.2.3