]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
RoseRuntimeState no longer needs to be packed
authorJustin Viiret <justin.viiret@intel.com>
Thu, 14 Jan 2016 05:55:39 +0000 (16:55 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 1 Mar 2016 00:29:04 +0000 (11:29 +1100)
This structure only contains u8 values now. In the future we may wish to
eliminate it entirely and store the few bits we need more directly.

src/rose/rose_build_bytecode.cpp
src/rose/rose_internal.h

index c640f0912ea5affe2f0e1d04c22d360b0693618a..a042eb2c5d1de666ce119d6d38989fe3003f9b18 100644 (file)
@@ -513,9 +513,14 @@ void fillStateOffsets(const RoseBuildImpl &tbi, u32 rolesWithStateCount,
                       u32 activeLeftCount, u32 laggedRoseCount,
                       u32 floatingStreamStateRequired, u32 historyRequired,
                       RoseStateOffsets *so) {
-    /* runtime state (including role state) first and needs to be u32-aligned */
-    u32 curr_offset = sizeof(RoseRuntimeState)
-                    + mmbit_size(rolesWithStateCount);
+    u32 curr_offset = 0;
+
+    // First, runtime state (stores per-stream state, like whether we need a
+    // delay rebuild or have been told to halt matching.)
+    curr_offset += sizeof(RoseRuntimeState);
+
+    // Role state storage.
+    curr_offset += mmbit_size(rolesWithStateCount);
 
     so->activeLeafArray = curr_offset; /* TODO: limit size of array */
     curr_offset += mmbit_size(activeArrayCount);
index a1f91cd3991ca71f3e11e9f65f051941ddcc1bb0..326887da8dec18f8b08df04ca5853e126c6250fe 100644 (file)
@@ -476,19 +476,11 @@ struct RoseEngine {
     struct scatter_full_plan state_init;
 };
 
-#if defined(_WIN32)
-#pragma pack(push, 1)
-#endif
 // Rose runtime state
 struct RoseRuntimeState {
     u8 flags; /* high bit true if delay rebuild needed */
     u8 broken; /* user has requested that we stop matching */
-#if defined(_WIN32)
 };
-#pragma pack(pop)
-#else
-} __attribute__((packed));
-#endif
 
 struct ALIGN_CL_DIRECTIVE anchored_matcher_info {
     u32 next_offset; /* relative to this, 0 for end */