File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ package maphash
8
8
9
9
import (
10
10
"internal/abi"
11
+ "internal/goarch"
11
12
"internal/goexperiment"
12
13
"unsafe"
13
14
)
@@ -27,7 +28,7 @@ func rthash(buf []byte, seed uint64) uint64 {
27
28
// The runtime hasher only works on uintptr. For 64-bit
28
29
// architectures, we use the hasher directly. Otherwise,
29
30
// we use two parallel hashers on the lower and upper 32 bits.
30
- if unsafe . Sizeof ( uintptr ( 0 )) == 8 {
31
+ if goarch . PtrSize == 8 {
31
32
return uint64 (runtime_memhash (unsafe .Pointer (& buf [0 ]), uintptr (seed ), uintptr (len )))
32
33
}
33
34
lo := runtime_memhash (unsafe .Pointer (& buf [0 ]), uintptr (seed ), uintptr (len ))
@@ -54,7 +55,7 @@ func comparableHash[T comparable](v T, seed Seed) uint64 {
54
55
} else {
55
56
hasher = (* abi .OldMapType )(unsafe .Pointer (mTyp )).Hasher
56
57
}
57
- if unsafe . Sizeof ( uintptr ( 0 )) == 8 {
58
+ if goarch . PtrSize == 8 {
58
59
return uint64 (hasher (abi .NoEscape (unsafe .Pointer (& v )), uintptr (s )))
59
60
}
60
61
lo := hasher (abi .NoEscape (unsafe .Pointer (& v )), uintptr (s ))
You can’t perform that action at this time.
0 commit comments