1
0
mirror of https://github.com/golang/go synced 2024-11-17 07:14:45 -07:00

runtime: short-circuit typedmemmove when dst==src

Change-Id: I855268a4c0d07ad602ec90f5da66422d3d87c5f2
Reviewed-on: https://go-review.googlesource.com/94595
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-11-12 21:36:20 -08:00
parent 68def82008
commit 486caa26d7

View File

@ -154,6 +154,9 @@ import (
//
//go:nosplit
func typedmemmove(typ *_type, dst, src unsafe.Pointer) {
if dst == src {
return
}
if typ.kind&kindNoPointers == 0 {
bulkBarrierPreWrite(uintptr(dst), uintptr(src), typ.size)
}