@@ -92,15 +92,15 @@ fn reinterpret_slice_mut_u64_u8(words: &mut [u64]) -> &mut [u8] {
92
92
/// approach combined with the elements of the dense-resetting approach in my `bit-storage-striped-hybrid`
93
93
/// solution.
94
94
pub struct FlagStorageUnrolledHybrid {
95
- words : Vec < u64 > ,
95
+ words : Box < [ u64 ] > ,
96
96
length_bits : usize ,
97
97
}
98
98
99
99
impl FlagStorage for FlagStorageUnrolledHybrid {
100
100
fn create_true ( size : usize ) -> Self {
101
101
let num_words = size / 64 + ( size % 64 ) . min ( 1 ) ;
102
102
Self {
103
- words : vec ! [ 0 ; num_words] ,
103
+ words : vec ! [ 0 ; num_words] . into_boxed_slice ( ) ,
104
104
length_bits : size,
105
105
}
106
106
}
@@ -118,10 +118,10 @@ impl FlagStorage for FlagStorageUnrolledHybrid {
118
118
/// ```ignore
119
119
/// // dense reset
120
120
/// match skip {
121
- /// 3 => ResetterDenseU64::<3>::reset_dense(&mut self.words),
122
- /// 5 => ResetterDenseU64::<5>::reset_dense(&mut self.words),
121
+ /// 3 => ResetterDenseU64::<3>::reset_dense(self.words.as_mut() ),
122
+ /// 5 => ResetterDenseU64::<5>::reset_dense(self.words.as_mut() ),
123
123
/// //... etc
124
- /// 129 => ResetterDenseU64::<129>::reset_dense(&mut self.words),
124
+ /// 129 => ResetterDenseU64::<129>::reset_dense(self.words.as_mut() ),
125
125
/// _ => debug_assert!(false, "this case should not occur"),
126
126
/// },
127
127
/// ```
@@ -135,7 +135,7 @@ impl FlagStorage for FlagStorageUnrolledHybrid {
135
135
3 ,
136
136
2 ,
137
137
17 ,
138
- ResetterSparseU8 :: <N >:: reset_sparse( & mut self . words, skip) ,
138
+ ResetterSparseU8 :: <N >:: reset_sparse( self . words. as_mut ( ) , skip) ,
139
139
debug_assert!(
140
140
false ,
141
141
"this case should not occur skip {} equivalent {}" ,
@@ -151,7 +151,7 @@ impl FlagStorage for FlagStorageUnrolledHybrid {
151
151
3 ,
152
152
2 ,
153
153
129 , // 64 unique sets
154
- ResetterDenseU64 :: <N >:: reset_dense( & mut self . words) ,
154
+ ResetterDenseU64 :: <N >:: reset_dense( self . words. as_mut ( ) ) ,
155
155
debug_assert!(
156
156
false ,
157
157
"dense reset function should not be called for skip {}" ,
0 commit comments