diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-14 19:21:31 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-14 19:21:31 -0800 |
| commit | 3cd61e3abc79a80d38afa9c633c59585aeb0311a (patch) | |
| tree | ebc97bfb416d0e9a0a486f754221b21a5a05fbc2 /types.h | |
| parent | 9238ffea8819461687e24ea45e466403faa68681 (diff) | |
Overhaul of memory tracking and left recursion. Added explanation doc
for left recursion and fixed all visible memory leaks.
Diffstat (limited to 'types.h')
| -rw-r--r-- | types.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -39,7 +39,7 @@ enum VMOpcode { VM_REF, VM_BACKREF, VM_NODENT, - VM_CANNED, + VM_LEFTRECURSION, }; struct match_s; // forward declared to resolve circular struct defs @@ -80,7 +80,7 @@ typedef struct vm_op_s { unsigned int visits; const char *at; struct vm_op_s *fallback; - } canned; + } leftrec; struct vm_op_s *pat; } args; } vm_op_t; @@ -93,7 +93,9 @@ typedef struct match_s { const char *start, *end; struct match_s *child, *nextsibling; vm_op_t *op; - unsigned int refcount; + // Intrusive linked list nodes for garbage collection: + struct match_s **atme, *next; + int refcount; } match_t; // |
