Auto merge of #147644 - cjgillot:bitsetvec, r=jackh726
Use regular Vec in BitSet. That code is hot enough for the branch in all accesses to `SmallVec` to appear in profiles.
This commit is contained in:
commit
779e19d8ba
1 changed files with 5 additions and 6 deletions
|
|
@ -8,7 +8,6 @@ use std::{fmt, iter, slice};
|
|||
use Chunk::*;
|
||||
#[cfg(feature = "nightly")]
|
||||
use rustc_macros::{Decodable_NoContext, Encodable_NoContext};
|
||||
use smallvec::{SmallVec, smallvec};
|
||||
|
||||
use crate::{Idx, IndexVec};
|
||||
|
||||
|
|
@ -118,7 +117,7 @@ macro_rules! bit_relations_inherent_impls {
|
|||
#[derive(Eq, PartialEq, Hash)]
|
||||
pub struct DenseBitSet<T> {
|
||||
domain_size: usize,
|
||||
words: SmallVec<[Word; 2]>,
|
||||
words: Vec<Word>,
|
||||
marker: PhantomData<T>,
|
||||
}
|
||||
|
||||
|
|
@ -134,7 +133,7 @@ impl<T: Idx> DenseBitSet<T> {
|
|||
#[inline]
|
||||
pub fn new_empty(domain_size: usize) -> DenseBitSet<T> {
|
||||
let num_words = num_words(domain_size);
|
||||
DenseBitSet { domain_size, words: smallvec![0; num_words], marker: PhantomData }
|
||||
DenseBitSet { domain_size, words: vec![0; num_words], marker: PhantomData }
|
||||
}
|
||||
|
||||
/// Creates a new, filled bitset with a given `domain_size`.
|
||||
|
|
@ -142,7 +141,7 @@ impl<T: Idx> DenseBitSet<T> {
|
|||
pub fn new_filled(domain_size: usize) -> DenseBitSet<T> {
|
||||
let num_words = num_words(domain_size);
|
||||
let mut result =
|
||||
DenseBitSet { domain_size, words: smallvec![!0; num_words], marker: PhantomData };
|
||||
DenseBitSet { domain_size, words: vec![!0; num_words], marker: PhantomData };
|
||||
result.clear_excess_bits();
|
||||
result
|
||||
}
|
||||
|
|
@ -1384,7 +1383,7 @@ impl<T: Idx> From<DenseBitSet<T>> for GrowableBitSet<T> {
|
|||
pub struct BitMatrix<R: Idx, C: Idx> {
|
||||
num_rows: usize,
|
||||
num_columns: usize,
|
||||
words: SmallVec<[Word; 2]>,
|
||||
words: Vec<Word>,
|
||||
marker: PhantomData<(R, C)>,
|
||||
}
|
||||
|
||||
|
|
@ -1397,7 +1396,7 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> {
|
|||
BitMatrix {
|
||||
num_rows,
|
||||
num_columns,
|
||||
words: smallvec![0; num_rows * words_per_row],
|
||||
words: vec![0; num_rows * words_per_row],
|
||||
marker: PhantomData,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue