mirror of https://github.com/golang/go.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 <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
65ea4c5021
commit
df6396fc22
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue