summaryrefslogtreecommitdiff
path: root/upb/def.c
diff options
context:
space:
mode:
Diffstat (limited to 'upb/def.c')
-rw-r--r--upb/def.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/upb/def.c b/upb/def.c
index f83f5eb..ee793a9 100644
--- a/upb/def.c
+++ b/upb/def.c
@@ -523,6 +523,13 @@ upb_msg_iter upb_msg_next(upb_msgdef *m, upb_msg_iter iter) {
/* upb_symtab *****************************************************************/
+struct _upb_symtab {
+ upb_atomic_t refcount;
+ upb_rwlock_t lock; // Protects all members except the refcount.
+ upb_strtable symtab; // The symbol table.
+ upb_deflist olddefs;
+};
+
typedef struct {
upb_def *def;
} upb_symtab_ent;
@@ -568,6 +575,8 @@ static void upb_symtab_free(upb_symtab *s) {
free(s);
}
+void upb_symtab_ref(upb_symtab *s) { upb_atomic_ref(&s->refcount); }
+
void upb_symtab_unref(upb_symtab *s) {
if(s && upb_atomic_unref(&s->refcount)) {
upb_symtab_free(s);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback