From daf36f07473b627ef634f8f66379a45ac99d32fc Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 16 Jul 2011 14:14:13 -0700 Subject: Get rid of upb_symtabtxn. This type was nothing but a map of defs. We can as easily just pass an array of defs into upb_symtab_add(). --- upb/atomic.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'upb/atomic.h') diff --git a/upb/atomic.h b/upb/atomic.h index 53501b5..d2b2bd2 100644 --- a/upb/atomic.h +++ b/upb/atomic.h @@ -20,6 +20,7 @@ #define UPB_ATOMIC_H_ #include +#include #ifdef __cplusplus extern "C" { @@ -45,7 +46,7 @@ typedef struct { INLINE void upb_atomic_init(upb_atomic_t *a, int val) { a->v = val; } INLINE bool upb_atomic_ref(upb_atomic_t *a) { return a->v++ == 0; } -INLINE bool upb_atomic_unref(upb_atomic_t *a) { return --a->v == 0; } +INLINE bool upb_atomic_unref(upb_atomic_t *a) { assert(a->v > 0); return --a->v == 0; } INLINE int upb_atomic_read(upb_atomic_t *a) { return a->v; } INLINE bool upb_atomic_add(upb_atomic_t *a, int val) { a->v += val; -- cgit v1.2.3