File tree 1 file changed +6
-0
lines changed
compiler/rustc_data_structures/src
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,13 @@ const BUFFER_SIZE_BYTES_SPILL: usize = BUFFER_SIZE_ELEMS_SPILL * ELEM_SIZE;
15
15
const BUFFER_SPILL_INDEX : usize = BUFFER_SIZE_ELEMS_SPILL - 1 ;
16
16
17
17
#[ derive( Debug , Clone ) ]
18
+ #[ repr( C ) ]
18
19
pub struct SipHasher128 {
20
+ // The access pattern during hashing consists of accesses to `nbuf` and
21
+ // `buf` until the buffer is full, followed by accesses to `state` and
22
+ // `processed`, and then repetition of that pattern until hashing is done.
23
+ // This is the basis for the ordering of fields below. However, in practice
24
+ // the cache miss-rate for data access is extremely low regardless of order.
19
25
nbuf : usize , // how many bytes in buf are valid
20
26
buf : [ MaybeUninit < u64 > ; BUFFER_SIZE_ELEMS_SPILL ] , // unprocessed bytes le
21
27
state : State , // hash State
You can’t perform that action at this time.
0 commit comments