summaryrefslogtreecommitdiff
path: root/src/upb_decoder.c
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-02-17 23:47:26 -0800
committerJoshua Haberman <joshua@reverberate.org>2011-02-17 23:47:26 -0800
commite75cff570c23f2d140b4fdf4e242436f72c83fdc (patch)
tree8813c88ea897c0a427582022a6c04b8ab91248af /src/upb_decoder.c
parentd8b215486245e84e33283b6047fb253bbb418e00 (diff)
Return updated buf as second return value, to free up a reg.
Diffstat (limited to 'src/upb_decoder.c')
-rw-r--r--src/upb_decoder.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/upb_decoder.c b/src/upb_decoder.c
index 0e6866b..47e67b6 100644
--- a/src/upb_decoder.c
+++ b/src/upb_decoder.c
@@ -13,9 +13,13 @@
// If the return value is other than UPB_CONTINUE, that is what the last
// callback returned.
-extern upb_flow_t upb_fastdecode(const char **p, const char *end,
- upb_value_handler_t value_cb, void *closure,
- void *table, int table_size);
+typedef struct {
+ upb_flow_t flow;
+ const char *ptr;
+} fastdecode_ret;
+extern fastdecode_ret upb_fastdecode(const char *p, const char *end,
+ upb_value_handler_t value_cb, void *closure,
+ void *table, int table_size);
/* Pure Decoding **************************************************************/
@@ -344,11 +348,13 @@ void upb_decoder_run(upb_src *src, upb_status *status) {
// before falling through to the slow(er) path.
const char *end = UPB_MIN(d->end, d->submsg_end);
#ifdef USE_ASSEMBLY_FASTPATH
- CHECK_FLOW(upb_fastdecode(&d->ptr, end,
- d->dispatcher.top->handlers.set->value,
- d->dispatcher.top->handlers.closure,
- d->top->msgdef->itof.array,
- d->top->msgdef->itof.array_size));
+ fastdecode_ret ret = upb_fastdecode(d->ptr, end,
+ d->dispatcher.top->handlers.set->value,
+ d->dispatcher.top->handlers.closure,
+ d->top->msgdef->itof.array,
+ d->top->msgdef->itof.array_size);
+ CHECK_FLOW(ret.flow);
+ d->ptr = ret.ptr;
if (end - d->ptr < 12) {
DEBUGPRINTF("Off the fast path because <12 bytes of data\n");
} else {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback