aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2024-05-17 12:07:15 -0400
committerGopher Robot <gobot@golang.org>2024-05-23 02:32:19 +0000
commitff2070d9398aff1c44691a90761eb35ea3cd4601 (patch)
tree77cb849fc27f0348ca652dd162ae3fbf9346ee33 /src/runtime/proc.go
parentfd1363240ac22583125d43d8e15f130f02a7659b (diff)
downloadgo-ff2070d9398aff1c44691a90761eb35ea3cd4601.tar.xz
runtime: move exit hooks into internal/runtime/exithook
This removes a //go:linkname usage in the coverage implementation. For #67401. Change-Id: I0602172c7e372a84465160dbf46d9fa371582fff Reviewed-on: https://go-review.googlesource.com/c/go/+/586259 Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 68296bd1e4..c5bf537a75 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -10,6 +10,7 @@ import (
"internal/goarch"
"internal/goos"
"internal/runtime/atomic"
+ "internal/runtime/exithook"
"internal/stringslite"
"runtime/internal/sys"
"unsafe"
@@ -309,6 +310,12 @@ func os_beforeExit(exitCode int) {
}
}
+func runExitHooks(code int) {
+ if err := exithook.Run(code); err != nil {
+ throw(err.Error())
+ }
+}
+
// start forcegc helper goroutine
func init() {
go forcegchelper()