mirror of
https://github.com/kemko/reproxy.git
synced 2026-01-01 15:55:49 +03:00
Bumps the go-modules-updates group with 2 updates in the / directory: [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) and [golang.org/x/crypto](https://github.com/golang/crypto). Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.20.2 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.20.2) Updates `golang.org/x/crypto` from 0.24.0 to 0.26.0 - [Commits](https://github.com/golang/crypto/compare/v0.24.0...v0.26.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-modules-updates - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-modules-updates ... Signed-off-by: dependabot[bot] <support@github.com>
35 lines
820 B
Go
35 lines
820 B
Go
// Package cpuinfo gives runtime info about the current CPU.
|
|
//
|
|
// This is a very limited module meant for use internally
|
|
// in this project. For more versatile solution check
|
|
// https://github.com/klauspost/cpuid.
|
|
package cpuinfo
|
|
|
|
// HasBMI1 checks whether an x86 CPU supports the BMI1 extension.
|
|
func HasBMI1() bool {
|
|
return hasBMI1
|
|
}
|
|
|
|
// HasBMI2 checks whether an x86 CPU supports the BMI2 extension.
|
|
func HasBMI2() bool {
|
|
return hasBMI2
|
|
}
|
|
|
|
// DisableBMI2 will disable BMI2, for testing purposes.
|
|
// Call returned function to restore previous state.
|
|
func DisableBMI2() func() {
|
|
old := hasBMI2
|
|
hasBMI2 = false
|
|
return func() {
|
|
hasBMI2 = old
|
|
}
|
|
}
|
|
|
|
// HasBMI checks whether an x86 CPU supports both BMI1 and BMI2 extensions.
|
|
func HasBMI() bool {
|
|
return HasBMI1() && HasBMI2()
|
|
}
|
|
|
|
var hasBMI1 bool
|
|
var hasBMI2 bool
|