1
0
mirror of https://github.com/golang/go synced 2024-11-23 05:00:07 -07:00

runtime: document sigtrampgo better

Add an explanation of why sigtrampgo is nosplit.

Updates #21314.

Change-Id: I3f5909d2b2c180f9fa74d53df13e501826fd4316
Reviewed-on: https://go-review.googlesource.com/79615
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Austin Clements 2017-11-22 21:58:57 -05:00
parent b6cf58d5b8
commit 294963fb7f

View File

@ -275,6 +275,12 @@ func sigpipe() {
// sigtrampgo is called from the signal handler function, sigtramp,
// written in assembly code.
// This is called by the signal handler, and the world may be stopped.
//
// It must be nosplit because getg() is still the G that was running
// (if any) when the signal was delivered, but it's (usually) called
// on the gsignal stack. Until this switches the G to gsignal, the
// stack bounds check won't work.
//
//go:nosplit
//go:nowritebarrierrec
func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {