aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/sys/cpu/cpu_arm64.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/sys/cpu/cpu_arm64.go')
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_arm64.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
index 87dd5e3..f3eb993 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
@@ -6,7 +6,10 @@ package cpu
import "runtime"
-const cacheLineSize = 64
+// cacheLineSize is used to prevent false sharing of cache lines.
+// We choose 128 because Apple Silicon, a.k.a. M1, has 128-byte cache line size.
+// It doesn't cost much and is much more future-proof.
+const cacheLineSize = 128
func initOptions() {
options = []option{
@@ -41,13 +44,10 @@ func archInit() {
switch runtime.GOOS {
case "freebsd":
readARM64Registers()
- case "linux", "netbsd":
+ case "linux", "netbsd", "openbsd":
doinit()
default:
- // Most platforms don't seem to allow reading these registers.
- //
- // OpenBSD:
- // See https://golang.org/issue/31746
+ // Many platforms don't seem to allow reading these registers.
setMinimalFeatures()
}
}