aboutsummaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-10-01 18:21:02 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-10-01 18:21:02 -0700
commit007959ca0ff350eeea512360ef39004a6b06fc81 (patch)
tree69328f38ddfc8f613979227d925e898e0ee9a773 /match.c
parentb67cb4643cc837728f5c527dbc5bf59958039735 (diff)
Better comments
Diffstat (limited to 'match.c')
-rw-r--r--match.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/match.c b/match.c
index cd284a2..56650bf 100644
--- a/match.c
+++ b/match.c
@@ -17,7 +17,7 @@
#define MAX_CACHE_SIZE (1<<14)
-// Cache datastructures
+// Cache entries for results of matching a pattern at a string position
typedef struct cache_hit_s {
pat_t *pat;
const char *start, *end;
@@ -25,12 +25,13 @@ typedef struct cache_hit_s {
struct cache_hit_s *next_probe;
} cache_hit_t;
+// Cache uses a hash table
typedef struct {
unsigned int size, occupancy, next_free;
cache_hit_t *hits;
} cache_t;
-// Data structure for various ambient state for matching
+// Data structure for holding ambient state values during matching
typedef struct match_ctx_s {
struct match_ctx_s *parent_ctx;
pat_t *defs;