aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/alg.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2024-09-16 16:07:25 -0400
committerMichael Pratt <mpratt@google.com>2024-09-17 17:01:26 +0000
commitd1c3f255fda8b9bf86990b55353ca14fbfe5b257 (patch)
treeb652f4a29fb9af7e57c1d26b278be82c71a00e7d /src/runtime/alg.go
parent4f881115d4067bda8a236aabcae8c41cdd13b4d0 (diff)
downloadgo-d1c3f255fda8b9bf86990b55353ca14fbfe5b257.tar.xz
runtime: move getclosureptr to internal/runtime/sys
Moving these intrinsics to a base package enables other internal/runtime packages to use them. There is no immediate need for getclosureptr outside of runtime, but it is moved for consistency with the other intrinsics. For #54766. Change-Id: Ia68b16a938c8cb84cb222469db28e3a83861be5d Reviewed-on: https://go-review.googlesource.com/c/go/+/613262 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/alg.go')
-rw-r--r--src/runtime/alg.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/alg.go b/src/runtime/alg.go
index 1c373b7f25..e183452fbe 100644
--- a/src/runtime/alg.go
+++ b/src/runtime/alg.go
@@ -8,6 +8,7 @@ import (
"internal/abi"
"internal/cpu"
"internal/goarch"
+ "internal/runtime/sys"
"unsafe"
)
@@ -34,7 +35,7 @@ func memhash128(p unsafe.Pointer, h uintptr) uintptr {
//go:nosplit
func memhash_varlen(p unsafe.Pointer, h uintptr) uintptr {
- ptr := getclosureptr()
+ ptr := sys.GetClosurePtr()
size := *(*uintptr)(unsafe.Pointer(ptr + unsafe.Sizeof(h)))
return memhash(p, h, size)
}