| 1 |
// Copyright 2025 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
//go:build !linux |
| 6 |
|
| 7 |
package runtime |
| 8 |
|
| 9 |
func defaultGOMAXPROCSInit() {} |
| 10 |
func defaultGOMAXPROCSUpdateGODEBUG() {} |
| 11 |
|
| 12 |
func defaultGOMAXPROCS(ncpu int32) int32 { |
| 13 |
// Use the total number of logical CPUs available now, as CPU affinity |
| 14 |
// may change after start. |
| 15 |
// |
| 16 |
// TODO(prattmic): On some GOOS getCPUCount can never change. Don't |
| 17 |
// bother calling over and over. |
| 18 |
|
| 19 |
procs := ncpu |
| 20 |
if procs <= 0 { |
| 21 |
procs = getCPUCount() |
| 22 |
} |
| 23 |
return procs |
| 24 |
} |