File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ impl Group {
5454 pub const WIDTH : usize = mem:: size_of :: < Self > ( ) ;
5555
5656 /// 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.
5859 ///
5960 /// This is guaranteed to be aligned to the group size.
6061 #[ inline]
@@ -63,7 +64,7 @@ impl Group {
6364 _align : Group ,
6465 bytes : [ u8 ; Group :: WIDTH ] ,
6566 } ;
66- const ALIGNED_BYTES : AlignedBytes = AlignedBytes {
67+ static ALIGNED_BYTES : AlignedBytes = AlignedBytes {
6768 bytes : [ EMPTY ; Group :: WIDTH ] ,
6869 } ;
6970 unsafe { & ALIGNED_BYTES . bytes }
Original file line number Diff line number Diff line change @@ -19,13 +19,14 @@ pub const BITMASK_MASK: BitMaskWord = 0xffff;
1919pub struct Group ( x86:: __m128i ) ;
2020
2121// FIXME: https://github.com/rust-lang/rust-clippy/issues/3859
22- #[ allow( clippy:: use_self) ]
22+ #[ allow( clippy:: use_self) ]
2323impl Group {
2424 /// Number of bytes in the group.
2525 pub const WIDTH : usize = mem:: size_of :: < Self > ( ) ;
2626
2727 /// 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.
2930 ///
3031 /// This is guaranteed to be aligned to the group size.
3132 #[ inline]
@@ -34,7 +35,7 @@ impl Group {
3435 _align : Group ,
3536 bytes : [ u8 ; Group :: WIDTH ] ,
3637 } ;
37- const ALIGNED_BYTES : AlignedBytes = AlignedBytes {
38+ static ALIGNED_BYTES : AlignedBytes = AlignedBytes {
3839 bytes : [ EMPTY ; Group :: WIDTH ] ,
3940 } ;
4041 unsafe { & ALIGNED_BYTES . bytes }
You can’t perform that action at this time.
0 commit comments