]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
mpvcompile: use bytecode_ptr
authorJustin Viiret <justin.viiret@intel.com>
Fri, 31 Mar 2017 00:25:04 +0000 (11:25 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Apr 2017 05:19:36 +0000 (15:19 +1000)
src/nfa/mpvcompile.cpp
src/nfa/mpvcompile.h

index 87fb462e5369cf2b6975dbb836908d247c5f2ac6..51787512710043f817b77e5068c5480e7686bcc0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -309,9 +309,9 @@ const mpv_counter_info &findCounter(const vector<mpv_counter_info> &counters,
     return counters.front();
 }
 
-aligned_unique_ptr<NFA> mpvCompile(const vector<raw_puff> &puffs_in,
-                                   const vector<raw_puff> &triggered_puffs,
-                                   const ReportManager &rm) {
+bytecode_ptr<NFA> mpvCompile(const vector<raw_puff> &puffs_in,
+                             const vector<raw_puff> &triggered_puffs,
+                             const ReportManager &rm) {
     assert(!puffs_in.empty() || !triggered_puffs.empty());
     u32 puffette_count = puffs_in.size() + triggered_puffs.size();
 
@@ -343,7 +343,7 @@ aligned_unique_ptr<NFA> mpvCompile(const vector<raw_puff> &puffs_in,
 
     DEBUG_PRINTF("%u puffs, len = %u\n", puffette_count, len);
 
-    aligned_unique_ptr<NFA> nfa = aligned_zmalloc_unique<NFA>(len);
+    auto nfa = make_bytecode_ptr<NFA>(len);
 
     mpv_puffette *pa_base = (mpv_puffette *)
         ((char *)nfa.get() + sizeof(NFA) + sizeof(mpv)
index fb91ac64ede703576eb254984d2c8dbee0f14f61..4f820e4365875a2b11c84d9477ef3196fb135e9d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -30,7 +30,7 @@
 #define MPV_COMPILE_H
 
 #include "ue2common.h"
-#include "util/alloc.h"
+#include "util/bytecode_ptr.h"
 #include "util/charreach.h"
 
 #include <memory>
@@ -61,9 +61,9 @@ struct raw_puff {
  * puffs in the triggered_puffs vector are enabled when an TOP_N event is
  * delivered corresponding to their index in the vector
  */
-aligned_unique_ptr<NFA> mpvCompile(const std::vector<raw_puff> &puffs,
-                                   const std::vector<raw_puff> &triggered_puffs,
-                                   const ReportManager &rm);
+bytecode_ptr<NFA> mpvCompile(const std::vector<raw_puff> &puffs,
+                             const std::vector<raw_puff> &triggered_puffs,
+                             const ReportManager &rm);
 
 } // namespace ue2