From 26d98ca94f2f049e8767b4a9a33d185a3d7ea0fd Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Thu, 24 Oct 2013 12:43:19 -0700 Subject: Merge from Google-internal development: - rewritten decoder; interpreted decoder is bytecode-based, JIT decoder no longer falls back to the interpreter. - C++ improvements: C++11-compatible iterators, upb::reffed_ptr for RAII refcounting, better upcast/downcast support. - removed the gross upb_value abstraction from public upb.h. --- upb/bytestream.upb.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'upb/bytestream.upb.c') diff --git a/upb/bytestream.upb.c b/upb/bytestream.upb.c index 4d84ec2..2da5405 100644 --- a/upb/bytestream.upb.c +++ b/upb/bytestream.upb.c @@ -9,14 +9,18 @@ const upb_fielddef upb_bytestream_fields[1]; const upb_enumdef upb_bytestream_enums[0]; const upb_tabent upb_bytestream_strentries[4]; const upb_tabent upb_bytestream_intentries[0]; -const _upb_value upb_bytestream_arrays[3]; +const _upb_value upb_bytestream_arrays[2]; + +#ifdef UPB_DEBUG_REFS +static upb_inttable reftables[4]; +#endif const upb_msgdef upb_bytestream_msgs[1] = { - UPB_MSGDEF_INIT("upb.ByteStream", UPB_INTTABLE_INIT(0, 0, 9, 0, NULL, &upb_bytestream_arrays[0], 3, 1), UPB_STRTABLE_INIT(1, 3, 9, 2, &upb_bytestream_strentries[0]), 5), + UPB_MSGDEF_INIT("upb.ByteStream", UPB_INTTABLE_INIT(0, 0, UPB_CTYPE_PTR, 0, NULL, &upb_bytestream_arrays[0], 2, 1), UPB_STRTABLE_INIT(1, 3, UPB_CTYPE_PTR, 2, &upb_bytestream_strentries[0]), 5, &reftables[0], &reftables[1]), }; const upb_fielddef upb_bytestream_fields[1] = { - UPB_FIELDDEF_INIT(UPB_LABEL_OPTIONAL, UPB_TYPE_BYTES, 0, false, "bytes", 1, &upb_bytestream_msgs[0], NULL, 2, UPB_VALUE_INIT_NONE), + UPB_FIELDDEF_INIT(UPB_LABEL_OPTIONAL, UPB_TYPE_BYTES, 0, false, "bytes", 1, &upb_bytestream_msgs[0], NULL, 2, {0},&reftables[2], &reftables[3]), }; const upb_enumdef upb_bytestream_enums[0] = { @@ -32,9 +36,17 @@ const upb_tabent upb_bytestream_strentries[4] = { const upb_tabent upb_bytestream_intentries[0] = { }; -const _upb_value upb_bytestream_arrays[3] = { +const _upb_value upb_bytestream_arrays[2] = { UPB_ARRAY_EMPTYENT, UPB_VALUE_INIT_CONSTPTR(&upb_bytestream_fields[0]), - UPB_ARRAY_EMPTYENT, }; +#ifdef UPB_DEBUG_REFS +static upb_inttable reftables[4] = { + UPB_EMPTY_INTTABLE_INIT(UPB_CTYPE_PTR), + UPB_EMPTY_INTTABLE_INIT(UPB_CTYPE_PTR), + UPB_EMPTY_INTTABLE_INIT(UPB_CTYPE_PTR), + UPB_EMPTY_INTTABLE_INIT(UPB_CTYPE_PTR), +}; +#endif + -- cgit v1.2.3