aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2025-12-03 15:15:30 -0800
committerGopher Robot <gobot@golang.org>2026-02-07 15:11:25 -0800
commit9777ceceec8fee294d038182739cab7c845ad2d1 (patch)
treeb6d8da99709a58c2d20cd09f5fb9bbff8f02ea4c /src/runtime
parentd440b8b48560d29995d299973e6c79bd11fb90e9 (diff)
downloadgo-9777ceceec8fee294d038182739cab7c845ad2d1.tar.xz
runtime: use unsafe.Slice in itabInit
As opposed to old style (*[1 << 16]T(p)[:n:n]. Change-Id: I6836f87741a2e2f6cef34f87cc839d15e309cc67 Reviewed-on: https://go-review.googlesource.com/c/go/+/726401 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/iface.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/iface.go b/src/runtime/iface.go
index 0665c4b984..c1f5f5b6e5 100644
--- a/src/runtime/iface.go
+++ b/src/runtime/iface.go
@@ -212,9 +212,9 @@ func itabInit(m *itab, firstTime bool) string {
// the loop is O(ni+nt) not O(ni*nt).
ni := len(inter.Methods)
nt := int(x.Mcount)
- xmhdr := (*[1 << 16]abi.Method)(add(unsafe.Pointer(x), uintptr(x.Moff)))[:nt:nt]
+ xmhdr := unsafe.Slice((*abi.Method)(add(unsafe.Pointer(x), uintptr(x.Moff))), nt)
j := 0
- methods := (*[1 << 16]unsafe.Pointer)(unsafe.Pointer(&m.Fun[0]))[:ni:ni]
+ methods := unsafe.Slice((*unsafe.Pointer)(unsafe.Pointer(&m.Fun[0])), ni)
var fun0 unsafe.Pointer
imethods:
for k := 0; k < ni; k++ {