]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
eod: tidy up, rename to roseStreamEodExec
authorJustin Viiret <justin.viiret@intel.com>
Tue, 14 Jun 2016 23:47:24 +0000 (09:47 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Fri, 8 Jul 2016 00:55:36 +0000 (10:55 +1000)
src/rose/eod.c
src/rose/rose.h
src/runtime.c

index 249e7a9c35534b29d549f0c32ecec143accc806c..dd471c971f2781e3fed23b694d4729edcaee07d1 100644 (file)
@@ -55,19 +55,32 @@ void initContext(const struct RoseEngine *t, u64a offset,
     fatbit_clear(scratch->aqa);
 }
 
-static really_inline
-void roseEodExec_i(const struct RoseEngine *t, u64a offset,
-                   struct hs_scratch *scratch, UNUSED const char is_streaming) {
-    assert(t);
-    assert(scratch->core_info.buf || scratch->core_info.hbuf);
-    assert(!scratch->core_info.buf || !scratch->core_info.hbuf);
-    assert(!can_stop_matching(scratch));
+void roseStreamEodExec(const struct RoseEngine *t, u64a offset,
+                       struct hs_scratch *scratch) {
+    assert(scratch);
+    assert(t->requiresEodCheck);
+    DEBUG_PRINTF("ci buf %p/%zu his %p/%zu\n", scratch->core_info.buf,
+                 scratch->core_info.len, scratch->core_info.hbuf,
+                 scratch->core_info.hlen);
+
+    // We should not have been called if we've already been told to terminate
+    // matching.
+    assert(!told_to_stop_matching(scratch));
+
+    if (t->maxBiAnchoredWidth != ROSE_BOUND_INF
+        && offset > t->maxBiAnchoredWidth) {
+        DEBUG_PRINTF("bailing, we are beyond max width\n");
+        /* also some of the history/state may be stale */
+        return;
+    }
 
     if (!t->eodProgramOffset) {
         DEBUG_PRINTF("no eod program\n");
         return;
     }
 
+    initContext(t, offset, scratch);
+
     DEBUG_PRINTF("running eod program at %u\n", t->eodProgramOffset);
 
     // There should be no pending delayed literals.
@@ -85,26 +98,3 @@ void roseEodExec_i(const struct RoseEngine *t, u64a offset,
     roseRunProgram(t, scratch, t->eodProgramOffset, som, offset, match_len,
                    in_anchored, in_catchup, from_mpv, skip_mpv_catchup);
 }
-
-void roseEodExec(const struct RoseEngine *t, u64a offset,
-                 struct hs_scratch *scratch) {
-    assert(scratch);
-    assert(t->requiresEodCheck);
-    DEBUG_PRINTF("ci buf %p/%zu his %p/%zu\n", scratch->core_info.buf,
-                 scratch->core_info.len, scratch->core_info.hbuf,
-                 scratch->core_info.hlen);
-
-    // We should not have been called if we've already been told to terminate
-    // matching.
-    assert(!told_to_stop_matching(scratch));
-
-    if (t->maxBiAnchoredWidth != ROSE_BOUND_INF
-        && offset > t->maxBiAnchoredWidth) {
-        DEBUG_PRINTF("bailing, we are beyond max width\n");
-        /* also some of the history/state may be stale */
-        return;
-    }
-
-    initContext(t, offset, scratch);
-    roseEodExec_i(t, offset, scratch, 1);
-}
index e3537774487cdeebd23ac20c22903f931e788743..ca8bf35331d4004498f3982a5e958e8829049995 100644 (file)
@@ -43,8 +43,8 @@ void roseBlockExec(const struct RoseEngine *t, struct hs_scratch *scratch);
 /* assumes core_info in scratch has been init to point to data */
 void roseStreamExec(const struct RoseEngine *t, struct hs_scratch *scratch);
 
-void roseEodExec(const struct RoseEngine *t, u64a offset,
-                 struct hs_scratch *scratch);
+void roseStreamEodExec(const struct RoseEngine *t, u64a offset,
+                       struct hs_scratch *scratch);
 
 hwlmcb_rv_t rosePureLiteralCallback(size_t start, size_t end, u32 id,
                                     void *context);
index 95f21d84e76203e3a109f9cd6a08c4c21520385d..7da41d298d3263bbe205b0ce7f6d07e07e6f50c4 100644 (file)
@@ -532,7 +532,7 @@ void rawEodExec(hs_stream_t *id, hs_scratch_t *scratch) {
         return;
     }
 
-    roseEodExec(rose, id->offset, scratch);
+    roseStreamEodExec(rose, id->offset, scratch);
 }
 
 static never_inline