mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: document scanstack
Also mark it go:systemstack and explain why. Change-Id: I88baf22741c04012ba2588d8e03dd3801d19b5c0 Reviewed-on: https://go-review.googlesource.com/23390 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
This commit is contained in:
parent
a689f6b8af
commit
a1f7db88f8
1 changed files with 10 additions and 0 deletions
|
|
@ -642,7 +642,17 @@ func gcFlushBgCredit(scanWork int64) {
|
|||
unlock(&work.assistQueue.lock)
|
||||
}
|
||||
|
||||
// scanstack scans gp's stack, greying all pointers found on the stack.
|
||||
//
|
||||
// During mark phase, it also installs stack barriers while traversing
|
||||
// gp's stack. During mark termination, it stops scanning when it
|
||||
// reaches an unhit stack barrier.
|
||||
//
|
||||
// scanstack is marked go:systemstack because it must not be preempted
|
||||
// while using a workbuf.
|
||||
//
|
||||
//go:nowritebarrier
|
||||
//go:systemstack
|
||||
func scanstack(gp *g) {
|
||||
if gp.gcscanvalid {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue