| … | … | @@ -22,7 +22,7 @@ |
| 22 | 22 | #include "parse/histogram.h" // count_t |
| 23 | 23 | |
| 24 | 24 | // Can undefine VERIFY_MATCH_LIST when done debugging... |
| 25 | #define VERIFY_MATCH_LIST | |
| 25 | // #define VERIFY_MATCH_LIST | |
| 26 | 26 | |
| 27 | 27 | /* On a 64-bit machine, this struct should be exactly (6+2)*8=64 bytes long. |
| 28 | 28 | * Lets try to keep it that way (for performance). */ |
| … | … | @@ -779,8 +779,10 @@ static void lrcnt_cache_match_list(wordvecp lrcnt_cache, count_context_t *ctxt, |
| 779 | 779 | } |
| 780 | 780 | dassert(dcnt > 0, "No disjuncts to cache"); |
| 781 | 781 | //if (dcnt == i-mlb) return NULL; |
| 782 | #ifdef VERIFY_MATCH_LIST | |
| 782 | 783 | lgdebug(+9, "MATCH_LIST %9d dir=%d mlb %zu cached %zu/%zu\n", |
| 783 | 784 | get_match_list_element(mchxt, mlb)->match_id, dir, mlb, dcnt, i-mlb); |
| 785 | #endif | |
| 784 | 786 | |
| 785 | 787 | match_list_cache *ml = pool_alloc_vec(ctxt->mlc_pool, dcnt + 1); |
| 786 | 788 | if (ml == NULL) return; /* Cannot allocate cache array */ |
| … | … | @@ -595,14 +595,14 @@ form_match_list(fast_matcher_t *ctxt, int w, |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | #ifdef VERIFY_MATCH_LIST |
| 598 | static uint16_t id = 0; | |
| 599 | uint16_t lid = ++id; /* A stable local copy, for multi-threading support. */ | |
| 598 | static _Atomic(uint16_t) id = 0; | |
| 599 | const uint16_t lid = ++id; /* A stable local copy, for multi-threading support. */ | |
| 600 | 600 | #else |
| 601 | 601 | const uint16_t lid = 0; |
| 602 | 602 | #endif |
| 603 | 603 | |
| 604 | 604 | lgdebug(+D_FAST_MATCHER, "MATCH_LIST %c%c %5d mlb %zu\n", |
| 605 | (mlcl == NULL) ? ' ' : 'L', (mlcr == NULL) ? ' ' : 'R', id, front); | |
| 605 | (mlcl == NULL) ? ' ' : 'L', (mlcr == NULL) ? ' ' : 'R', lid, front); | |
| 606 | 606 | |
| 607 | 607 | if (mlcr == NULL) |
| 608 | 608 | { |
| … | … | @@ -71,12 +71,14 @@ static inline Disjunct *get_match_list_element(fast_matcher_t *ctxt, size_t mli) |
| 71 | 71 | static inline void pop_match_list(fast_matcher_t *ctxt, size_t match_list_last) |
| 72 | 72 | { |
| 73 | 73 | ctxt->match_list_end = match_list_last; |
| 74 | #ifdef VERIFY_MATCH_LIST | |
| 74 | 75 | if (verbosity_level(9)) |
| 75 | 76 | { |
| 76 | 77 | if (get_match_list_element(ctxt, match_list_last) != NULL) |
| 77 | 78 | lgdebug(+9, "MATCH_LIST %9d pop\n", |
| 78 | 79 | get_match_list_element(ctxt, match_list_last)->match_id); |
| 79 | 80 | } |
| 81 | #endif | |
| 80 | 82 | } |
| 81 | 83 | |
| 82 | 84 | /** |