Commit 5a50e003 authored by Austin Clements's avatar Austin Clements

runtime: improve comment on selectgo

In particular, document that *sel is on the stack no matter what.

Change-Id: I1c264215e026c27721b13eedae73ec845066cdec
Reviewed-on: https://go-review.googlesource.com/20032Reviewed-by: default avatarRick Hudson <rlh@golang.org>
parent 8a2d6e9f
......@@ -208,8 +208,15 @@ func block() {
gopark(nil, nil, "select (no cases)", traceEvGoStop, 1) // forever
}
// overwrites return pc on stack to signal which case of the select
// to run, so cannot appear at the top of a split stack.
// selectgo implements the select statement.
//
// *sel is on the current goroutine's stack (regardless of any
// escaping in selectgo).
//
// selectgo does not return. Instead, it overwrites its return PC and
// returns directly to the triggered select case. Because of this, it
// cannot appear at the top of a split stack.
//
//go:nosplit
func selectgo(sel *hselect) {
pc, offset := selectgoImpl(sel)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment