From 1e870951d7707d45fa7104658a4dde177d9fb62e Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 19 Aug 2015 15:49:29 -0700 Subject: Refer to a shared definition for max buffered bytes. --- upb/pb/decoder.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'upb/pb/decoder.h') diff --git a/upb/pb/decoder.h b/upb/pb/decoder.h index 65316b4..8172a99 100644 --- a/upb/pb/decoder.h +++ b/upb/pb/decoder.h @@ -36,6 +36,13 @@ UPB_DECLARE_TYPE(upb::pb::DecoderMethodOptions, upb_pbdecodermethodopts) UPB_DECLARE_DERIVED_TYPE(upb::pb::DecoderMethod, upb::RefCounted, upb_pbdecodermethod, upb_refcounted) +/* The maximum number of bytes we are required to buffer internally between + * calls to the decoder. The value is 14: a 5 byte unknown tag plus ten-byte + * varint, less one because we are buffering an incomplete value. + * + * Should only be used by unit tests. */ +#define UPB_DECODER_MAX_RESIDUAL_BYTES 14 + #ifdef __cplusplus /* The parameters one uses to construct a DecoderMethod. -- cgit v1.2.3