From 5f4ec3541f53233db2a60d638d8d673889d28187 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 24 Oct 2025 14:57:55 -0700 Subject: [PATCH] runtime: remove unused cgoCheckUsingType function The only calls to it were removed in CL 616255. Change-Id: I6c6b01e2e98d54300b6323fd74ccc45fa1d433dd Reviewed-on: https://go-review.googlesource.com/c/go/+/714820 Reviewed-by: Tobias Klauser LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek Reviewed-by: David Chase Auto-Submit: Ian Lance Taylor --- src/runtime/cgocheck.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/runtime/cgocheck.go b/src/runtime/cgocheck.go index ab804a5a36..81300adfcf 100644 --- a/src/runtime/cgocheck.go +++ b/src/runtime/cgocheck.go @@ -177,27 +177,3 @@ func cgoCheckBits(src unsafe.Pointer, gcbits *byte, off, size uintptr) { } } } - -// cgoCheckUsingType is like cgoCheckTypedBlock, but is a last ditch -// fall back to look for pointers in src using the type information. -// We only use this when looking at a value on the stack when the type -// uses a GC program, because otherwise it's more efficient to use the -// GC bits. This is called on the system stack. -// -//go:nowritebarrier -//go:systemstack -func cgoCheckUsingType(typ *_type, src unsafe.Pointer, off, size uintptr) { - if !typ.Pointers() { - return - } - - // Anything past typ.PtrBytes is not a pointer. - if typ.PtrBytes <= off { - return - } - if ptrdataSize := typ.PtrBytes - off; size > ptrdataSize { - size = ptrdataSize - } - - cgoCheckBits(src, getGCMask(typ), off, size) -} -- 2.52.0