1
0
mirror of https://github.com/golang/go synced 2024-11-23 18:00:06 -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:
David Crawshaw 2016-11-02 09:10:29 -04:00
parent 7bf0fc9fc3
commit 47c1715ba5
2 changed files with 2 additions and 5 deletions

View File

@ -475,7 +475,7 @@ func schedinit() {
goargs() goargs()
goenvs() goenvs()
parsedebugvars() parsedebugvars()
gcinit() // requires modulesinit gcinit()
sched.lastpoll = uint64(nanotime()) sched.lastpoll = uint64(nanotime())
procs := ncpu procs := ncpu

View File

@ -267,13 +267,10 @@ func activeModules() []*moduledata {
// //
// Only one goroutine may call modulesinit at a time. // Only one goroutine may call modulesinit at a time.
func modulesinit() { func modulesinit() {
oldNum := len(activeModules())
modules := new([]*moduledata) modules := new([]*moduledata)
num := 0
for md := &firstmoduledata; md != nil; md = md.next { for md := &firstmoduledata; md != nil; md = md.next {
*modules = append(*modules, md) *modules = append(*modules, md)
num++ if md.gcdatamask == (bitvector{}) {
if num > oldNum {
md.gcdatamask = progToPointerMask((*byte)(unsafe.Pointer(md.gcdata)), md.edata-md.data) md.gcdatamask = progToPointerMask((*byte)(unsafe.Pointer(md.gcdata)), md.edata-md.data)
md.gcbssmask = progToPointerMask((*byte)(unsafe.Pointer(md.gcbss)), md.ebss-md.bss) md.gcbssmask = progToPointerMask((*byte)(unsafe.Pointer(md.gcbss)), md.ebss-md.bss)
} }