File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,12 +52,14 @@ pub trait HashTable {
5252const HASHTABLE_SIZE_4K : usize = 4 * 1024 ;
5353const HASHTABLE_BIT_SHIFT_4K : usize = 4 ;
5454
55+ /// A 4K entry hash table using 16-bit values.
5556#[ derive( Debug ) ]
5657#[ repr( align( 64 ) ) ]
5758pub struct HashTable4KU16 {
5859 dict : Box < [ u16 ; HASHTABLE_SIZE_4K ] > ,
5960}
6061impl HashTable4KU16 {
62+ /// Creates a new zeroed hash table.
6163 #[ inline]
6264 pub fn new ( ) -> Self {
6365 // This generates more efficient assembly in contrast to Box::new(slice), because of an
@@ -89,11 +91,13 @@ impl HashTable for HashTable4KU16 {
8991 }
9092}
9193
94+ /// A 4K entry hash table using 32-bit values.
9295#[ derive( Debug ) ]
9396pub struct HashTable4K {
9497 dict : Box < [ u32 ; HASHTABLE_SIZE_4K ] > ,
9598}
9699impl HashTable4K {
100+ /// Creates a new zeroed hash table.
97101 #[ inline]
98102 pub fn new ( ) -> Self {
99103 let dict = alloc:: vec![ 0 ; HASHTABLE_SIZE_4K ]
@@ -103,6 +107,7 @@ impl HashTable4K {
103107 Self { dict }
104108 }
105109
110+ /// Shifts all entries down by `offset`, clamping at zero.
106111 #[ cold]
107112 #[ allow( dead_code) ]
108113 pub fn reposition ( & mut self , offset : u32 ) {
You can’t perform that action at this time.
0 commit comments