From 0941664215ed7fa4a8d53b6387d50c56df6757d0 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Fri, 20 May 2011 11:26:27 -0700 Subject: Add startseq/endseq handlers. Startseq/endseq handlers are called at the beginning and end of a sequence of repeated values. Protobuf does not really have direct support for this (repeated primitive fields do not delimit "begin" and "end" of the sequence) but we can infer them from the bytestream. The benefit of supporting them explicitly is that they get their own stack frame and closure, so we can avoid having to find the array's address over and over and deciding if we need to initialize it. This will also pave the way for better support of JSON, which does have explicit "startseq/endseq" markers: []. --- tests/tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/tests.c b/tests/tests.c index dea535c..747593a 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -40,7 +40,7 @@ static void test_upb_jit() { upb_handlers h; upb_handlers_init(&h); - upb_handlerset hset = {NULL, NULL, &upb_test_onvalue, NULL, NULL}; + upb_handlerset hset = {NULL, NULL, &upb_test_onvalue, NULL, NULL, NULL, NULL}; upb_handlers_reghandlerset(&h, upb_downcast_msgdef(def), &hset); upb_decoder d; upb_decoder_init(&d, &h); -- cgit v1.2.3