From 0a6fc5fad3cee99bf4da97214a2ca3deccc9b132 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 6 Dec 2009 16:29:29 -0800 Subject: Truly fixed type cyclic refcounting. --- src/upb.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/upb.h') diff --git a/src/upb.h b/src/upb.h index 66706c5..237281f 100644 --- a/src/upb.h +++ b/src/upb.h @@ -25,6 +25,7 @@ extern "C" { #define UPB_MAX(x, y) ((x) > (y) ? (x) : (y)) #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y)) +#define UPB_INDEX(base, i, m) (void*)((char*)(base) + ((i)*(m))) // The maximum that any submessages can be nested. Matches proto2's limit. #define UPB_MAX_NESTING 64 @@ -37,11 +38,10 @@ typedef int16_t upb_field_count_t; // Nested type names are separated by periods. #define UPB_SYMBOL_SEPARATOR '.' + // This limit is for the longest fully-qualified symbol, eg. foo.bar.MsgType #define UPB_SYMBOL_MAXLEN 128 -#define UPB_INDEX(base, i, m) (void*)((char*)(base) + ((i)*(m))) - // The longest chain that mutually-recursive types are allowed to form. For // example, this is a type cycle of length 2: // message A { @@ -52,6 +52,9 @@ typedef int16_t upb_field_count_t; // } #define UPB_MAX_TYPE_CYCLE_LEN 16 +// The maximum depth that the type graph can have. +#define UPB_MAX_TYPE_DEPTH 64 + /* Fundamental types and type constants. **************************************/ // A list of types as they are encoded on-the-wire. -- cgit v1.2.3