From: Josh Bleecher Snyder Date: Tue, 22 Aug 2017 13:27:48 +0000 (-0700) Subject: runtime: remove t.indirectvalue handling in fast evacuation routines X-Git-Tag: go1.10beta1~1321 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8adaf68570eef206ca8720d5c0c861e04d2a0108;p=gostls13.git runtime: remove t.indirectvalue handling in fast evacuation routines Maps with indirect values use the generic map routines. Change-Id: Ib211e93f1dacefb988ba3d279f92a13065168079 Reviewed-on: https://go-review.googlesource.com/59135 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall Reviewed-by: Martin Möhrmann --- diff --git a/src/runtime/hashmap_fast.go b/src/runtime/hashmap_fast.go index a69b5316be..c378647892 100644 --- a/src/runtime/hashmap_fast.go +++ b/src/runtime/hashmap_fast.go @@ -846,11 +846,7 @@ func evacuate_fast32(t *maptype, h *hmap, oldbucket uintptr) { *(*uint32)(dst.k) = *(*uint32)(k) } - if t.indirectvalue { - *(*unsafe.Pointer)(dst.v) = *(*unsafe.Pointer)(v) - } else { - typedmemmove(t.elem, dst.v, v) - } + typedmemmove(t.elem, dst.v, v) dst.i++ // These updates might push these pointers past the end of the // key or value arrays. That's ok, as we have the overflow pointer @@ -956,11 +952,7 @@ func evacuate_fast64(t *maptype, h *hmap, oldbucket uintptr) { *(*uint64)(dst.k) = *(*uint64)(k) } - if t.indirectvalue { - *(*unsafe.Pointer)(dst.v) = *(*unsafe.Pointer)(v) - } else { - typedmemmove(t.elem, dst.v, v) - } + typedmemmove(t.elem, dst.v, v) dst.i++ // These updates might push these pointers past the end of the // key or value arrays. That's ok, as we have the overflow pointer @@ -1056,11 +1048,7 @@ func evacuate_faststr(t *maptype, h *hmap, oldbucket uintptr) { // Copy key. *(*string)(dst.k) = *(*string)(k) - if t.indirectvalue { - *(*unsafe.Pointer)(dst.v) = *(*unsafe.Pointer)(v) - } else { - typedmemmove(t.elem, dst.v, v) - } + typedmemmove(t.elem, dst.v, v) dst.i++ // These updates might push these pointers past the end of the // key or value arrays. That's ok, as we have the overflow pointer