From: Daniel Martí Date: Fri, 7 Apr 2023 17:41:10 +0000 (+0100) Subject: reflect: remove typedmemmovepartial as it is unused X-Git-Tag: go1.21rc1~974 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=df6396fc22823e9ab666d2d06c86f219d5129926;p=gostls13.git reflect: remove typedmemmovepartial as it is unused It appears to have been unused since https://go.dev/cl/298670 in April 2021, as that change removed its only use. It is always in the git history if it is needed again. Change-Id: Ie55d059c102dfaa75bd253e09d48a4b30f45e941 Reviewed-on: https://go-review.googlesource.com/c/go/+/483136 Reviewed-by: Michael Pratt TryBot-Result: Gopher Robot Run-TryBot: Daniel Martí Reviewed-by: Michael Knyszek Auto-Submit: Michael Pratt --- diff --git a/src/reflect/value.go b/src/reflect/value.go index 5efc333221..fb29769e87 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -3832,12 +3832,6 @@ func memmove(dst, src unsafe.Pointer, size uintptr) //go:noescape func typedmemmove(t *rtype, dst, src unsafe.Pointer) -// typedmemmovepartial is like typedmemmove but assumes that -// dst and src point off bytes into the value and only copies size bytes. -// -//go:noescape -func typedmemmovepartial(t *rtype, dst, src unsafe.Pointer, off, size uintptr) - // typedmemclr zeros the value at ptr of type t. // //go:noescape diff --git a/src/runtime/mbarrier.go b/src/runtime/mbarrier.go index 6d2ff22930..e367d8f524 100644 --- a/src/runtime/mbarrier.go +++ b/src/runtime/mbarrier.go @@ -217,29 +217,6 @@ func reflectlite_typedmemmove(typ *_type, dst, src unsafe.Pointer) { reflect_typedmemmove(typ, dst, src) } -// reflect_typedmemmovepartial is like typedmemmove but assumes that -// dst and src point off bytes into the value and only copies size bytes. -// off must be a multiple of goarch.PtrSize. -// -//go:linkname reflect_typedmemmovepartial reflect.typedmemmovepartial -func reflect_typedmemmovepartial(typ *_type, dst, src unsafe.Pointer, off, size uintptr) { - if writeBarrier.needed && typ.ptrdata > off && size >= goarch.PtrSize { - if off&(goarch.PtrSize-1) != 0 { - panic("reflect: internal error: misaligned offset") - } - pwsize := alignDown(size, goarch.PtrSize) - if poff := typ.ptrdata - off; pwsize > poff { - pwsize = poff - } - bulkBarrierPreWrite(uintptr(dst), uintptr(src), pwsize) - } - - memmove(dst, src, size) - if goexperiment.CgoCheck2 { - cgoCheckMemmove2(typ, dst, src, off, size) - } -} - // reflectcallmove is invoked by reflectcall to copy the return values // out of the stack and into the heap, invoking the necessary write // barriers. dst, src, and size describe the return value area to