mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: update outdated comments for deferprocStack
Change-Id: I0ea4d15da163cec6fe2a703376ce5a6032e15484 Reviewed-on: https://go-review.googlesource.com/c/go/+/714861 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org>
This commit is contained in:
parent
e12d8a90bf
commit
eaf28a27fd
1 changed files with 2 additions and 4 deletions
|
|
@ -545,15 +545,13 @@ func deferprocStack(d *_defer) {
|
||||||
d.rangefunc = false
|
d.rangefunc = false
|
||||||
d.sp = sys.GetCallerSP()
|
d.sp = sys.GetCallerSP()
|
||||||
// The lines below implement:
|
// The lines below implement:
|
||||||
// d.panic = nil
|
|
||||||
// d.fd = nil
|
|
||||||
// d.link = gp._defer
|
// d.link = gp._defer
|
||||||
// d.head = nil
|
// d.head = nil
|
||||||
// gp._defer = d
|
// gp._defer = d
|
||||||
// But without write barriers. The first three are writes to
|
// But without write barriers. The first two are writes to
|
||||||
// the stack so they don't need a write barrier, and furthermore
|
// the stack so they don't need a write barrier, and furthermore
|
||||||
// are to uninitialized memory, so they must not use a write barrier.
|
// are to uninitialized memory, so they must not use a write barrier.
|
||||||
// The fourth write does not require a write barrier because we
|
// The third write does not require a write barrier because we
|
||||||
// explicitly mark all the defer structures, so we don't need to
|
// explicitly mark all the defer structures, so we don't need to
|
||||||
// keep track of pointers to them with a write barrier.
|
// keep track of pointers to them with a write barrier.
|
||||||
*(*uintptr)(unsafe.Pointer(&d.link)) = uintptr(unsafe.Pointer(gp._defer))
|
*(*uintptr)(unsafe.Pointer(&d.link)) = uintptr(unsafe.Pointer(gp._defer))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue