File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ impl Group {
54
54
pub const WIDTH : usize = mem:: size_of :: < Self > ( ) ;
55
55
56
56
/// Returns a full group of empty bytes, suitable for use as the initial
57
- /// value for an empty hash table.
57
+ /// value for an empty hash table. This value is explicitly declared as
58
+ /// a static variable to ensure the address is consistent across dylibs.
58
59
///
59
60
/// This is guaranteed to be aligned to the group size.
60
61
#[ inline]
@@ -63,7 +64,7 @@ impl Group {
63
64
_align : Group ,
64
65
bytes : [ u8 ; Group :: WIDTH ] ,
65
66
} ;
66
- const ALIGNED_BYTES : AlignedBytes = AlignedBytes {
67
+ static ALIGNED_BYTES : AlignedBytes = AlignedBytes {
67
68
bytes : [ EMPTY ; Group :: WIDTH ] ,
68
69
} ;
69
70
unsafe { & ALIGNED_BYTES . bytes }
Original file line number Diff line number Diff line change @@ -19,13 +19,14 @@ pub const BITMASK_MASK: BitMaskWord = 0xffff;
19
19
pub struct Group ( x86:: __m128i ) ;
20
20
21
21
// FIXME: https://github.com/rust-lang/rust-clippy/issues/3859
22
- #[ allow( clippy:: use_self) ]
22
+ #[ allow( clippy:: use_self) ]
23
23
impl Group {
24
24
/// Number of bytes in the group.
25
25
pub const WIDTH : usize = mem:: size_of :: < Self > ( ) ;
26
26
27
27
/// Returns a full group of empty bytes, suitable for use as the initial
28
- /// value for an empty hash table.
28
+ /// value for an empty hash table. This value is explicitly declared as
29
+ /// a static variable to ensure the address is consistent across dylibs.
29
30
///
30
31
/// This is guaranteed to be aligned to the group size.
31
32
#[ inline]
@@ -34,7 +35,7 @@ impl Group {
34
35
_align : Group ,
35
36
bytes : [ u8 ; Group :: WIDTH ] ,
36
37
} ;
37
- const ALIGNED_BYTES : AlignedBytes = AlignedBytes {
38
+ static ALIGNED_BYTES : AlignedBytes = AlignedBytes {
38
39
bytes : [ EMPTY ; Group :: WIDTH ] ,
39
40
} ;
40
41
unsafe { & ALIGNED_BYTES . bytes }
You can’t perform that action at this time.
0 commit comments