From 47c1715ba5ea7d5ecc9eff846f448d8a3b62808d Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Wed, 2 Nov 2016 09:10:29 -0400 Subject: [PATCH] runtime: address comments from CL 32357 Change-Id: I174d7307bfdd8ec57bb4266dab8569fd2234abb4 Reviewed-on: https://go-review.googlesource.com/32610 Reviewed-by: Austin Clements Run-TryBot: David Crawshaw TryBot-Result: Gobot Gobot --- src/runtime/proc.go | 2 +- src/runtime/symtab.go | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 1f47dc4de40..baec534aaf7 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -475,7 +475,7 @@ func schedinit() { goargs() goenvs() parsedebugvars() - gcinit() // requires modulesinit + gcinit() sched.lastpoll = uint64(nanotime()) procs := ncpu diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index 9ec95d7a0ca..bba3ccfc206 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -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) }