mirror of
https://github.com/golang/sys.git
synced 2026-01-29 07:02:06 +03:00
unix: switch (*CPUSet).Zero to clear builtin
clear was added to Go 1.21 and is better than the manual loop approach.
Change-Id: I851203714446e21b6329e2bcf308f2571d339e36
GitHub-Last-Rev: 71dc7f073e
GitHub-Pull-Request: golang/sys#262
Reviewed-on: https://go-review.googlesource.com/c/sys/+/698495
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Keith Randall <khr@golang.org>
This commit is contained in:
committed by
Gopher Robot
parent
899c23279d
commit
9bd37534d8
@@ -38,9 +38,7 @@ func SchedSetaffinity(pid int, set *CPUSet) error {
|
||||
|
||||
// Zero clears the set s, so that it contains no CPUs.
|
||||
func (s *CPUSet) Zero() {
|
||||
for i := range s {
|
||||
s[i] = 0
|
||||
}
|
||||
clear(s[:])
|
||||
}
|
||||
|
||||
func cpuBitsIndex(cpu int) int {
|
||||
|
||||
Reference in New Issue
Block a user