aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_test.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2020-10-22 16:55:55 +0000
committerMichael Knyszek <mknyszek@google.com>2021-03-11 17:26:22 +0000
commitf009b5b2268a7fcdfe046057cbf2a75306dbfc5e (patch)
tree0c5da8482cab010c564e36528dab31c7364e095a /src/runtime/export_test.go
parent415ca3f1f0fa05a98561752e0787f59b77f19645 (diff)
downloadgo-f009b5b2268a7fcdfe046057cbf2a75306dbfc5e.tar.gz
go-f009b5b2268a7fcdfe046057cbf2a75306dbfc5e.zip
runtime: support register ABI for finalizers
This change modifies runfinq to properly pass arguments to finalizers in registers via reflectcall. For #40724. Change-Id: I414c0eff466ef315a0eb10507994e598dd29ccb2 Reviewed-on: https://go-review.googlesource.com/c/go/+/300112 Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r--src/runtime/export_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go
index 5a87024b8a..195b7b0519 100644
--- a/src/runtime/export_test.go
+++ b/src/runtime/export_test.go
@@ -1220,3 +1220,18 @@ func (th *TimeHistogram) Count(bucket, subBucket uint) (uint64, bool) {
func (th *TimeHistogram) Record(duration int64) {
(*timeHistogram)(th).record(duration)
}
+
+func SetIntArgRegs(a int) int {
+ lock(&finlock)
+ old := intArgRegs
+ intArgRegs = a
+ unlock(&finlock)
+ return old
+}
+
+func FinalizerGAsleep() bool {
+ lock(&finlock)
+ result := fingwait
+ unlock(&finlock)
+ return result
+}