]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
block: unify roseBlockExec and roseBlockExec_i
authorJustin Viiret <justin.viiret@intel.com>
Tue, 14 Jun 2016 23:35:48 +0000 (09:35 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Fri, 8 Jul 2016 00:55:36 +0000 (10:55 +1000)
src/rose/block.c
src/rose/rose.h

index 0e70f54957238a362324abe818781360701f8cd3..c0b5e0e44b75a26374064a69322872acb7b18977 100644 (file)
@@ -266,13 +266,28 @@ int roseBlockFloating(const struct RoseEngine *t, struct hs_scratch *scratch) {
     return can_stop_matching(scratch);
 }
 
-void roseBlockExec_i(const struct RoseEngine *t, struct hs_scratch *scratch) {
+void roseBlockExec(const struct RoseEngine *t, struct hs_scratch *scratch) {
     assert(t);
     assert(scratch);
     assert(scratch->core_info.buf);
     assert(mmbit_sparse_iter_state_size(t->rolesWithStateCount)
            < MAX_SPARSE_ITER_STATES);
 
+    // We should not have been called if we've already been told to terminate
+    // matching.
+    assert(!told_to_stop_matching(scratch));
+
+    // If this block is shorter than our minimum width, then no pattern in this
+    // RoseEngine could match.
+    /* minWidth checks should have already been performed by the caller */
+    assert(scratch->core_info.len >= t->minWidth);
+
+    // Similarly, we may have a maximum width (for engines constructed entirely
+    // of bi-anchored patterns).
+    /* This check is now handled by the interpreter */
+    assert(t->maxBiAnchoredWidth == ROSE_BOUND_INF
+           || scratch->core_info.len <= t->maxBiAnchoredWidth);
+
     const size_t length = scratch->core_info.len;
 
     // We have optimizations for small block scans: we run a single coalesced
index 5b7940a24c683920cbc5a3aa41ba172e49b9182c..e3537774487cdeebd23ac20c22903f931e788743 100644 (file)
 #ifndef ROSE_H
 #define ROSE_H
 
-#include "rose_types.h"
-#include "rose_internal.h"
-#include "runtime.h"
-#include "scratch.h"
 #include "ue2common.h"
-#include "util/multibit.h"
+
+struct RoseEngine;
+struct hs_scratch;
 
 // Initialise state space for engine use.
 void roseInitState(const struct RoseEngine *t, char *state);
 
-void roseBlockExec_i(const struct RoseEngine *t, struct hs_scratch *scratch);
-
 /* assumes core_info in scratch has been init to point to data */
-static really_inline
-void roseBlockExec(const struct RoseEngine *t, struct hs_scratch *scratch) {
-    assert(t);
-    assert(scratch);
-    assert(scratch->core_info.buf);
-
-    // We should not have been called if we've already been told to terminate
-    // matching.
-    assert(!told_to_stop_matching(scratch));
-
-    // If this block is shorter than our minimum width, then no pattern in this
-    // RoseEngine could match.
-    /* minWidth checks should have already been performed by the caller */
-    assert(scratch->core_info.len >= t->minWidth);
-
-    // Similarly, we may have a maximum width (for engines constructed entirely
-    // of bi-anchored patterns).
-    /* This check is now handled by the interpreter */
-    assert(t->maxBiAnchoredWidth == ROSE_BOUND_INF
-           || scratch->core_info.len <= t->maxBiAnchoredWidth);
-
-    roseBlockExec_i(t, scratch);
-}
+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);