From 8adaf68570eef206ca8720d5c0c861e04d2a0108 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 22 Aug 2017 06:27:48 -0700 Subject: [PATCH] runtime: remove t.indirectvalue handling in fast evacuation routines MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/runtime/hashmap_fast.go | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) 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 -- 2.48.1