Commit 47c1715b authored by David Crawshaw's avatar David Crawshaw

runtime: address comments from CL 32357

Change-Id: I174d7307bfdd8ec57bb4266dab8569fd2234abb4
Reviewed-on: https://go-review.googlesource.com/32610Reviewed-by: default avatarAustin Clements <austin@google.com>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 7bf0fc9f
......@@ -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)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment