mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
415ca3f1f0
commit
f009b5b226
4 changed files with 191 additions and 14 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue