]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: address comments from CL 32357
authorDavid Crawshaw <crawshaw@golang.org>
Wed, 2 Nov 2016 13:10:29 +0000 (09:10 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Wed, 2 Nov 2016 13:49:25 +0000 (13:49 +0000)
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>

src/runtime/proc.go
src/runtime/symtab.go

index 1f47dc4de402e5f39cd566966ed309a66c565a8b..baec534aaf7cde086737788419c7feb6afa02e77 100644 (file)
@@ -475,7 +475,7 @@ func schedinit() {
        goargs()
        goenvs()
        parsedebugvars()
-       gcinit() // requires modulesinit
+       gcinit()
 
        sched.lastpoll = uint64(nanotime())
        procs := ncpu
index 9ec95d7a0cafbac54ca86c9e5944d44433117a53..bba3ccfc2069c7ca2f23b0870fae7157aadb8230 100644 (file)
@@ -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)
                }