mirror of
https://github.com/golang/go
synced 2024-11-23 15:20:03 -07:00
runtime: address comments from CL 32357
Change-Id: I174d7307bfdd8ec57bb4266dab8569fd2234abb4 Reviewed-on: https://go-review.googlesource.com/32610 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
7bf0fc9fc3
commit
47c1715ba5
@ -475,7 +475,7 @@ func schedinit() {
|
||||
goargs()
|
||||
goenvs()
|
||||
parsedebugvars()
|
||||
gcinit() // requires modulesinit
|
||||
gcinit()
|
||||
|
||||
sched.lastpoll = uint64(nanotime())
|
||||
procs := ncpu
|
||||
|
@ -267,13 +267,10 @@ func activeModules() []*moduledata {
|
||||
//
|
||||
// Only one goroutine may call modulesinit at a time.
|
||||
func modulesinit() {
|
||||
oldNum := len(activeModules())
|
||||
modules := new([]*moduledata)
|
||||
num := 0
|
||||
for md := &firstmoduledata; md != nil; md = md.next {
|
||||
*modules = append(*modules, md)
|
||||
num++
|
||||
if num > oldNum {
|
||||
if md.gcdatamask == (bitvector{}) {
|
||||
md.gcdatamask = progToPointerMask((*byte)(unsafe.Pointer(md.gcdata)), md.edata-md.data)
|
||||
md.gcbssmask = progToPointerMask((*byte)(unsafe.Pointer(md.gcbss)), md.ebss-md.bss)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user