github.com/prysmaticlabs/prysm@v1.4.4/shared/bls/blst/init.go (about)

     1  // +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64
     2  // +build !blst_disabled
     3  
     4  package blst
     5  
     6  import (
     7  	"runtime"
     8  
     9  	blst "github.com/supranational/blst/bindings/go"
    10  )
    11  
    12  func init() {
    13  	// Reserve 1 core for general application work
    14  	maxProcs := runtime.GOMAXPROCS(0) - 1
    15  	if maxProcs <= 0 {
    16  		maxProcs = 1
    17  	}
    18  	blst.SetMaxProcs(maxProcs)
    19  }