aboutsummaryrefslogtreecommitdiff
path: root/vm.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-14 19:21:31 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-14 19:21:31 -0800
commit3cd61e3abc79a80d38afa9c633c59585aeb0311a (patch)
treeebc97bfb416d0e9a0a486f754221b21a5a05fbc2 /vm.h
parent9238ffea8819461687e24ea45e466403faa68681 (diff)
Overhaul of memory tracking and left recursion. Added explanation doc
for left recursion and fixed all visible memory leaks.
Diffstat (limited to 'vm.h')
-rw-r--r--vm.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/vm.h b/vm.h
index 2127eca..3e7526b 100644
--- a/vm.h
+++ b/vm.h
@@ -8,14 +8,17 @@
#include "types.h"
-__attribute__((nonnull(2,3,4)))
+__attribute__((hot, nonnull(2,3,4)))
match_t *match(def_t *defs, file_t *f, const char *str, vm_op_t *op, unsigned int flags);
__attribute__((nonnull))
-void destroy_match(match_t **m);
-__attribute__((nonnull))
match_t *get_capture(match_t *m, const char **id);
__attribute__((nonnull))
void destroy_op(vm_op_t *op);
+match_t *new_match(void);
+size_t free_all_matches(void);
+__attribute__((nonnull))
+void recycle_if_unused(match_t **at_m);
+size_t recycle_all_matches(void);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1