|
27 | 27 |
|
28 | 28 | use std::cell::UnsafeCell; |
29 | 29 |
|
30 | | -use tinyvec::TinyVec; |
31 | | - |
32 | 30 | /// Per-rule mutable state reused across scans. |
33 | 31 | /// |
34 | 32 | /// Each rule has one `WordState` slot in [`SimpleMatchState::word_states`], |
@@ -96,19 +94,19 @@ pub(super) struct WordState { |
96 | 94 | pub(super) struct SimpleMatchState { |
97 | 95 | /// Per-rule state slots indexed by rule id. |
98 | 96 | pub(super) word_states: Vec<WordState>, |
99 | | - /// Per-variant counter matrix for complex rules (one `TinyVec` per rule |
| 97 | + /// Per-variant counter matrix for complex rules (one `Vec` per rule |
100 | 98 | /// index). |
101 | 99 | /// |
102 | 100 | /// `matrix[rule_idx][segment * num_variants + variant_idx]` holds the |
103 | 101 | /// remaining count for that segment in that variant. Initialized lazily |
104 | 102 | /// on first touch. |
105 | | - pub(super) matrix: Vec<TinyVec<[i32; 16]>>, |
106 | | - /// Per-segment completion flags for complex rules (one `TinyVec` per rule |
| 103 | + pub(super) matrix: Vec<Vec<i32>>, |
| 104 | + /// Per-segment completion flags for complex rules (one `Vec` per rule |
107 | 105 | /// index). |
108 | 106 | /// |
109 | 107 | /// `matrix_status[rule_idx][segment]` is 0 if the segment is still pending, |
110 | 108 | /// 1 if it has been satisfied (AND) or triggered (NOT). |
111 | | - pub(super) matrix_status: Vec<TinyVec<[u8; 16]>>, |
| 109 | + pub(super) matrix_status: Vec<Vec<u8>>, |
112 | 110 | /// Rule indices touched during the current scan generation. |
113 | 111 | /// |
114 | 112 | /// Cleared at the start of each scan in [`prepare`](Self::prepare). Used by |
@@ -163,8 +161,8 @@ pub(super) struct ScanState<'a> { |
163 | 161 | pub(super) word_states: &'a mut [WordState], |
164 | 162 | pub(super) touched_indices: &'a mut Vec<usize>, |
165 | 163 | pub(super) resolved_count: usize, |
166 | | - pub(super) matrix: &'a mut [TinyVec<[i32; 16]>], |
167 | | - pub(super) matrix_status: &'a mut [TinyVec<[u8; 16]>], |
| 164 | + pub(super) matrix: &'a mut [Vec<i32>], |
| 165 | + pub(super) matrix_status: &'a mut [Vec<u8>], |
168 | 166 | pub(super) generation: u32, |
169 | 167 | } |
170 | 168 |
|
@@ -333,8 +331,8 @@ impl SimpleMatchState { |
333 | 331 |
|
334 | 332 | if self.word_states.len() < size { |
335 | 333 | self.word_states.resize(size, WordState::default()); |
336 | | - self.matrix.resize(size, TinyVec::new()); |
337 | | - self.matrix_status.resize(size, TinyVec::new()); |
| 334 | + self.matrix.resize(size, Vec::new()); |
| 335 | + self.matrix_status.resize(size, Vec::new()); |
338 | 336 | } |
339 | 337 |
|
340 | 338 | self.touched_indices.clear(); |
@@ -371,8 +369,8 @@ impl SimpleMatchState { |
371 | 369 | #[cold] |
372 | 370 | #[inline(never)] |
373 | 371 | pub(super) fn init_matrix( |
374 | | - flat_matrix: &mut TinyVec<[i32; 16]>, |
375 | | - flat_status: &mut TinyVec<[u8; 16]>, |
| 372 | + flat_matrix: &mut Vec<i32>, |
| 373 | + flat_status: &mut Vec<u8>, |
376 | 374 | segment_counts: &[i32], |
377 | 375 | num_variants: usize, |
378 | 376 | ) { |
|
0 commit comments