summaryrefslogtreecommitdiff
path: root/upb/handlers.h
diff options
context:
space:
mode:
Diffstat (limited to 'upb/handlers.h')
-rw-r--r--upb/handlers.h9
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;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback