]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Rename reduceQueue to reduceInfixQueue
authorJustin Viiret <justin.viiret@intel.com>
Thu, 11 Feb 2016 03:38:12 +0000 (14:38 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 1 Mar 2016 00:34:57 +0000 (11:34 +1100)
src/rose/infix.h
src/rose/program_runtime.h
src/rose/stream.c

index 785d6354d13f3ad95331ce25c3f95a8706ce01d3..0cc63fdf0595268e30dbdfa8217a43a850288ff2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2016, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -63,12 +63,13 @@ int infixTooOld(struct mq *q, s64a curr_loc) {
  * engine.
  */
 static really_inline
-void reduceQueue(struct mq *q, s64a curr_loc, u32 maxTops, u32 maxAge) {
+void reduceInfixQueue(struct mq *q, s64a curr_loc, u32 maxTops, u32 maxAge) {
     assert(q->end > q->cur);
     assert(maxTops);
     u32 qlen = q->end - q->cur; /* includes MQE_START */
     DEBUG_PRINTF("q=%p, len=%u, maxTops=%u maxAge=%u\n", q, qlen, maxTops,
                  maxAge);
+
     char any_work = 0;
     if (maxAge && q->items[q->cur].location + maxAge < curr_loc) {
         any_work = 1;
index a8734cb7ecb9142241099e4508288269c337c2a6..075f0fc61027745064c4ebefdc6af5ef4084b5e9 100644 (file)
@@ -442,7 +442,7 @@ char roseTestLeftfix(const struct RoseEngine *t, struct hs_scratch *scratch,
                 goto nfa_dead;
             }
 
-            reduceQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
+            reduceInfixQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
         }
 
         if (!rosePrefixCheckMiracles(t, left, ci, q, end)) {
@@ -540,10 +540,10 @@ void roseTriggerInfix(const struct RoseEngine *t, struct hs_scratch *scratch,
         pushQueueAt(q, 0, MQE_START, loc);
         nfaQueueInitState(q->nfa, q);
     } else if (isQueueFull(q)) {
-        reduceQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
+        reduceInfixQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
 
         if (isQueueFull(q)) {
-            /* still full - reduceQueue did nothing */
+            /* still full - reduceInfixQueue did nothing */
             DEBUG_PRINTF("queue %u full (%u items) -> catching up nfa\n", qi,
                          q->end - q->cur);
             pushQueueNoMerge(q, MQE_END, loc);
index bd3021454343bf24bceb248ec9c8966ca6625c19..161e005962bb70beb6481f03d73ac6084b7e416c 100644 (file)
@@ -291,7 +291,7 @@ char roseCatchUpLeftfix(const struct RoseEngine *t, char *state,
             DEBUG_PRINTF("infix died of old age\n");
             return 0;
         }
-        reduceQueue(q, last_loc, left->maxQueueLen, q->nfa->maxWidth);
+        reduceInfixQueue(q, last_loc, left->maxQueueLen, q->nfa->maxWidth);
     }
 
     DEBUG_PRINTF("end scan at %lld\n", last_loc);