mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: remove useless nFlushCacheRoots
Change-Id: I70cb8f8e9a0eec68ea11f22ca8699aa7e0c91ede Reviewed-on: https://go-review.googlesource.com/c/go/+/310710 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Trust: Emmanuel Odeke <emmanuel@orijtech.com>
This commit is contained in:
parent
b05903a9f6
commit
94817890c2
2 changed files with 2 additions and 10 deletions
|
|
@ -325,11 +325,9 @@ var work struct {
|
||||||
nwait uint32
|
nwait uint32
|
||||||
|
|
||||||
// Number of roots of various root types. Set by gcMarkRootPrepare.
|
// Number of roots of various root types. Set by gcMarkRootPrepare.
|
||||||
nFlushCacheRoots int
|
|
||||||
nDataRoots, nBSSRoots, nSpanRoots, nStackRoots int
|
nDataRoots, nBSSRoots, nSpanRoots, nStackRoots int
|
||||||
|
|
||||||
// Base indexes of each root type. Set by gcMarkRootPrepare.
|
// Base indexes of each root type. Set by gcMarkRootPrepare.
|
||||||
baseFlushCache uint32
|
|
||||||
baseData, baseBSS, baseSpans, baseStacks, baseEnd uint32
|
baseData, baseBSS, baseSpans, baseStacks, baseEnd uint32
|
||||||
|
|
||||||
// Each type of GC state transition is protected by a lock.
|
// Each type of GC state transition is protected by a lock.
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,6 @@ const (
|
||||||
func gcMarkRootPrepare() {
|
func gcMarkRootPrepare() {
|
||||||
assertWorldStopped()
|
assertWorldStopped()
|
||||||
|
|
||||||
work.nFlushCacheRoots = 0
|
|
||||||
|
|
||||||
// Compute how many data and BSS root blocks there are.
|
// Compute how many data and BSS root blocks there are.
|
||||||
nBlocks := func(bytes uintptr) int {
|
nBlocks := func(bytes uintptr) int {
|
||||||
return int(divRoundUp(bytes, rootBlockBytes))
|
return int(divRoundUp(bytes, rootBlockBytes))
|
||||||
|
|
@ -105,11 +103,10 @@ func gcMarkRootPrepare() {
|
||||||
work.nStackRoots = int(atomic.Loaduintptr(&allglen))
|
work.nStackRoots = int(atomic.Loaduintptr(&allglen))
|
||||||
|
|
||||||
work.markrootNext = 0
|
work.markrootNext = 0
|
||||||
work.markrootJobs = uint32(fixedRootCount + work.nFlushCacheRoots + work.nDataRoots + work.nBSSRoots + work.nSpanRoots + work.nStackRoots)
|
work.markrootJobs = uint32(fixedRootCount + work.nDataRoots + work.nBSSRoots + work.nSpanRoots + work.nStackRoots)
|
||||||
|
|
||||||
// Calculate base indexes of each root type
|
// Calculate base indexes of each root type
|
||||||
work.baseFlushCache = uint32(fixedRootCount)
|
work.baseData = uint32(fixedRootCount)
|
||||||
work.baseData = work.baseFlushCache + uint32(work.nFlushCacheRoots)
|
|
||||||
work.baseBSS = work.baseData + uint32(work.nDataRoots)
|
work.baseBSS = work.baseData + uint32(work.nDataRoots)
|
||||||
work.baseSpans = work.baseBSS + uint32(work.nBSSRoots)
|
work.baseSpans = work.baseBSS + uint32(work.nBSSRoots)
|
||||||
work.baseStacks = work.baseSpans + uint32(work.nSpanRoots)
|
work.baseStacks = work.baseSpans + uint32(work.nSpanRoots)
|
||||||
|
|
@ -159,9 +156,6 @@ var oneptrmask = [...]uint8{1}
|
||||||
func markroot(gcw *gcWork, i uint32) {
|
func markroot(gcw *gcWork, i uint32) {
|
||||||
// Note: if you add a case here, please also update heapdump.go:dumproots.
|
// Note: if you add a case here, please also update heapdump.go:dumproots.
|
||||||
switch {
|
switch {
|
||||||
case work.baseFlushCache <= i && i < work.baseData:
|
|
||||||
flushmcache(int(i - work.baseFlushCache))
|
|
||||||
|
|
||||||
case work.baseData <= i && i < work.baseBSS:
|
case work.baseData <= i && i < work.baseBSS:
|
||||||
for _, datap := range activeModules() {
|
for _, datap := range activeModules() {
|
||||||
markrootBlock(datap.data, datap.edata-datap.data, datap.gcdatamask.bytedata, gcw, int(i-work.baseData))
|
markrootBlock(datap.data, datap.edata-datap.data, datap.gcdatamask.bytedata, gcw, int(i-work.baseData))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue