diff options
author | Josh Haberman <jhaberman@gmail.com> | 2013-10-24 12:43:19 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2013-10-24 12:43:19 -0700 |
commit | 26d98ca94f2f049e8767b4a9a33d185a3d7ea0fd (patch) | |
tree | 340bcf495f06ed05c9f3fb423f210caf4edce2b1 /upb/handlers.h | |
parent | 61109fca1f967771c21dc7184aee35f3b439c577 (diff) |
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.
Diffstat (limited to 'upb/handlers.h')
-rw-r--r-- | upb/handlers.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/upb/handlers.h b/upb/handlers.h index 2108046..bb9c3b6 100644 --- a/upb/handlers.h +++ b/upb/handlers.h @@ -45,6 +45,15 @@ typedef struct upb_handlers upb_handlers; typedef struct upb_sinkframe upb_sinkframe; #endif +// The maximum depth that the handler graph can have. This is a resource limit +// for the C stack since we sometimes need to recursively traverse the graph. +// Cycles are ok; the traversal will stop when it detects a cycle, but we must +// hit the cycle before the maximum depth is reached. +// +// If having a single static limit is too inflexible, we can add another variant +// of Handlers::Freeze that allows specifying this as a parameter. +#define UPB_MAX_HANDLER_DEPTH 64 + typedef struct { void (*func)(); const void *data; |