aboutsummaryrefslogtreecommitdiff
path: root/pattern.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-09-26 13:12:02 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-09-26 13:12:02 -0700
commit77d9007a88a18e0dee08aa9ba93e3aec86375572 (patch)
tree5dddf51ce1dfba7fe5272fc024bb839868a789ab /pattern.h
parentee0174001b385944c6a2b3b1fb6ba861613cb4f7 (diff)
Refactor of pat_t memory management to use doubly linked lists, and
moving the recursive freeing code from Lua/lbp.c into pattern.c
Diffstat (limited to 'pattern.h')
-rw-r--r--pattern.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/pattern.h b/pattern.h
index ef08441..3a78f13 100644
--- a/pattern.h
+++ b/pattern.h
@@ -42,7 +42,7 @@ enum pattype_e {
// A struct reperesenting a BP virtual machine operation
//
typedef struct pat_s {
- struct pat_s *next;
+ struct pat_s *next, **home;
enum pattype_e type;
const char *start, *end;
// The bounds of the match length (used for backtracking)
@@ -115,8 +115,9 @@ pat_t *chain_together(pat_t *first, pat_t *second);
pat_t *either_pat(pat_t *first, pat_t *second);
__attribute__((nonnull))
maybe_pat_t bp_pattern(const char *str, const char *end);
-
-void free_pat(pat_t *pat);
+void free_all_pats(void);
+__attribute__((nonnull))
+void delete_pat(pat_t **at_pat, bool recursive);
#endif