File tree 9 files changed +538
-503
lines changed
9 files changed +538
-503
lines changed Original file line number Diff line number Diff line change @@ -50,20 +50,23 @@ impl Group {
50
50
/// Number of bytes in the group.
51
51
pub ( crate ) const WIDTH : usize = mem:: size_of :: < Self > ( ) ;
52
52
53
+ /// Double the group width; size of [`Group::static_empty`].
54
+ pub ( crate ) const DOUBLE_WIDTH : usize = Group :: WIDTH * 2 ;
55
+
53
56
/// Returns a full group of empty tags, suitable for use as the initial
54
57
/// value for an empty hash table.
55
58
///
56
59
/// This is guaranteed to be aligned to the group size.
57
60
#[ inline]
58
- pub ( crate ) const fn static_empty ( ) -> & ' static [ Tag ; Group :: WIDTH ] {
61
+ pub ( crate ) const fn static_empty ( ) -> & ' static [ Tag ; Group :: DOUBLE_WIDTH ] {
59
62
#[ repr( C ) ]
60
63
struct AlignedTags {
61
64
_align : [ Group ; 0 ] ,
62
- tags : [ Tag ; Group :: WIDTH ] ,
65
+ tags : [ Tag ; Group :: DOUBLE_WIDTH ] ,
63
66
}
64
67
const ALIGNED_TAGS : AlignedTags = AlignedTags {
65
68
_align : [ ] ,
66
- tags : [ Tag :: EMPTY ; Group :: WIDTH ] ,
69
+ tags : [ Tag :: EMPTY ; Group :: DOUBLE_WIDTH ] ,
67
70
} ;
68
71
& ALIGNED_TAGS . tags
69
72
}
Original file line number Diff line number Diff line change @@ -21,20 +21,23 @@ impl Group {
21
21
/// Number of bytes in the group.
22
22
pub ( crate ) const WIDTH : usize = mem:: size_of :: < Self > ( ) ;
23
23
24
+ /// Double the group width; size of [`Group::static_empty`].
25
+ pub ( crate ) const DOUBLE_WIDTH : usize = Group :: WIDTH * 2 ;
26
+
24
27
/// Returns a full group of empty tags, suitable for use as the initial
25
28
/// value for an empty hash table.
26
29
///
27
30
/// This is guaranteed to be aligned to the group size.
28
31
#[ inline]
29
- pub ( crate ) const fn static_empty ( ) -> & ' static [ Tag ; Group :: WIDTH ] {
32
+ pub ( crate ) const fn static_empty ( ) -> & ' static [ Tag ; Group :: DOUBLE_WIDTH ] {
30
33
#[ repr( C ) ]
31
34
struct AlignedTags {
32
35
_align : [ Group ; 0 ] ,
33
- tags : [ Tag ; Group :: WIDTH ] ,
36
+ tags : [ Tag ; Group :: DOUBLE_WIDTH ] ,
34
37
}
35
38
const ALIGNED_TAGS : AlignedTags = AlignedTags {
36
39
_align : [ ] ,
37
- tags : [ Tag :: EMPTY ; Group :: WIDTH ] ,
40
+ tags : [ Tag :: EMPTY ; Group :: DOUBLE_WIDTH ] ,
38
41
} ;
39
42
& ALIGNED_TAGS . tags
40
43
}
Original file line number Diff line number Diff line change @@ -26,21 +26,24 @@ impl Group {
26
26
/// Number of bytes in the group.
27
27
pub ( crate ) const WIDTH : usize = mem:: size_of :: < Self > ( ) ;
28
28
29
+ /// Double the group width; size of [`Group::static_empty`].
30
+ pub ( crate ) const DOUBLE_WIDTH : usize = Group :: WIDTH * 2 ;
31
+
29
32
/// Returns a full group of empty tags, suitable for use as the initial
30
33
/// value for an empty hash table.
31
34
///
32
35
/// This is guaranteed to be aligned to the group size.
33
36
#[ inline]
34
37
#[ allow( clippy:: items_after_statements) ]
35
- pub ( crate ) const fn static_empty ( ) -> & ' static [ Tag ; Group :: WIDTH ] {
38
+ pub ( crate ) const fn static_empty ( ) -> & ' static [ Tag ; Group :: DOUBLE_WIDTH ] {
36
39
#[ repr( C ) ]
37
40
struct AlignedTags {
38
41
_align : [ Group ; 0 ] ,
39
- tags : [ Tag ; Group :: WIDTH ] ,
42
+ tags : [ Tag ; Group :: DOUBLE_WIDTH ] ,
40
43
}
41
44
const ALIGNED_TAGS : AlignedTags = AlignedTags {
42
45
_align : [ ] ,
43
- tags : [ Tag :: EMPTY ; Group :: WIDTH ] ,
46
+ tags : [ Tag :: EMPTY ; Group :: DOUBLE_WIDTH ] ,
44
47
} ;
45
48
& ALIGNED_TAGS . tags
46
49
}
Original file line number Diff line number Diff line change 1
1
mod bitmask;
2
2
mod group;
3
+ mod probe;
3
4
mod tag;
4
5
5
6
use self :: bitmask:: BitMask ;
6
7
pub ( crate ) use self :: {
7
8
bitmask:: BitMaskIter ,
8
9
group:: Group ,
10
+ probe:: { Probe , ProbeItems } ,
9
11
tag:: { Tag , TagSliceExt } ,
10
12
} ;
You can’t perform that action at this time.
0 commit comments