From e7f94bbf50e7d68c3294efc4d437598b8b56b92d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 13 Jan 2021 18:56:22 -0800 Subject: Working towards zero memory leakage --- types.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'types.h') diff --git a/types.h b/types.h index ad7781b..b8c2b68 100644 --- a/types.h +++ b/types.h @@ -39,6 +39,7 @@ enum VMOpcode { VM_REF, VM_BACKREF, VM_NODENT, + VM_CANNED, }; struct match_s; // forward declared to resolve circular struct defs @@ -74,6 +75,12 @@ typedef struct vm_op_s { char *name; } capture; struct match_s *backref; + struct { + struct match_s *match; + unsigned int visits; + const char *at; + struct vm_op_s *fallback; + } canned; struct vm_op_s *pat; } args; } vm_op_t; @@ -86,12 +93,14 @@ typedef struct match_s { const char *start, *end; struct match_s *child, *nextsibling; vm_op_t *op; + unsigned int refcount; } match_t; // // Pattern matching rule definition(s) // typedef struct def_s { + size_t namelen; const char *name; file_t *file; vm_op_t *op; -- cgit v1.2.3