diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2016-04-21 16:26:52 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2016-04-21 16:26:52 -0700 |
commit | ac2689cec721eb94b49dfbfed310e2e0e3bdfa2b (patch) | |
tree | 1f6b0b65b2a8b49d281b23ed4a1ef066525e4556 /upb/refcounted.h | |
parent | e6fa3f9d869765544b8e424e8573fe8d9af35534 (diff) |
Put oneofs in the same table as fields. (#60)
* Put oneofs in the same table as fields.
Oneofs and fields are not allowed to have names that conflict,
so we might as well put them all in the same table. This also
allows an efficient operation that looks for both fields and
oneofs in a single lookup.
Added support for OneofDef to Lua to allow testing of this.
* Addressed PR comments.
Diffstat (limited to 'upb/refcounted.h')
-rw-r--r-- | upb/refcounted.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/upb/refcounted.h b/upb/refcounted.h index 54c1127..115fc43 100644 --- a/upb/refcounted.h +++ b/upb/refcounted.h @@ -103,10 +103,11 @@ struct upb_refcounted { #ifdef UPB_DEBUG_REFS extern upb_alloc upb_alloc_debugrefs; -#define UPB_REFCOUNT_INIT(refs, ref2s) \ - {&static_refcount, NULL, NULL, 0, true, refs, ref2s} +#define UPB_REFCOUNT_INIT(vtbl, refs, ref2s) \ + {&static_refcount, NULL, vtbl, 0, true, refs, ref2s} #else -#define UPB_REFCOUNT_INIT(refs, ref2s) {&static_refcount, NULL, NULL, 0, true} +#define UPB_REFCOUNT_INIT(vtbl, refs, ref2s) \ + {&static_refcount, NULL, vtbl, 0, true} #endif UPB_BEGIN_EXTERN_C |