From 3cd61e3abc79a80d38afa9c633c59585aeb0311a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 14 Jan 2021 19:21:31 -0800 Subject: Overhaul of memory tracking and left recursion. Added explanation doc for left recursion and fixed all visible memory leaks. --- vm.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'vm.h') 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 -- cgit v1.2.3