mirror of
https://github.com/golang/go.git
synced 2025-10-20 11:33:18 +00:00
runtime: fix nStackRoots comment about stack roots
A comment in mgcmark.go indicates that we scan stacks a second time but we don't, at least not since changing to the hybrid write barrier. Change-Id: I9376adbb6d8b6dd9dc3cee62e077b5dfb8a3fdde Reviewed-on: https://go-review.googlesource.com/c/go/+/279797 Trust: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
d1502b3c72
commit
fb96f07e1a
1 changed files with 1 additions and 2 deletions
|
@ -101,8 +101,7 @@ func gcMarkRootPrepare() {
|
||||||
// Gs may be created after this point, but it's okay that we
|
// Gs may be created after this point, but it's okay that we
|
||||||
// ignore them because they begin life without any roots, so
|
// ignore them because they begin life without any roots, so
|
||||||
// there's nothing to scan, and any roots they create during
|
// there's nothing to scan, and any roots they create during
|
||||||
// the concurrent phase will be scanned during mark
|
// the concurrent phase will be caught by the write barrier.
|
||||||
// termination.
|
|
||||||
work.nStackRoots = int(atomic.Loaduintptr(&allglen))
|
work.nStackRoots = int(atomic.Loaduintptr(&allglen))
|
||||||
|
|
||||||
work.markrootNext = 0
|
work.markrootNext = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue