From 776c33ee5ed67a00bd05912bd15a7c8062daab88 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 17 Aug 2017 18:25:54 -0700 Subject: [PATCH] runtime: make evacDst a top level type MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This will reduce duplication when evacuate is specialized. Change-Id: I34cdfb7103442d3e0ea908c970fb46334b86d5c4 Reviewed-on: https://go-review.googlesource.com/56934 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Daniel Martí Reviewed-by: Avelino Reviewed-by: Keith Randall TryBot-Result: Gobot Gobot --- src/runtime/hashmap.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go index f53f7087d8..17a69646ca 100644 --- a/src/runtime/hashmap.go +++ b/src/runtime/hashmap.go @@ -1021,6 +1021,14 @@ func bucketEvacuated(t *maptype, h *hmap, bucket uintptr) bool { return evacuated(b) } +// evacDst is an evacuation destination. +type evacDst struct { + b *bmap // current destination bucket + i int // key/val index into b + k unsafe.Pointer // pointer to current key storage + v unsafe.Pointer // pointer to current value storage +} + func evacuate(t *maptype, h *hmap, oldbucket uintptr) { b := (*bmap)(add(h.oldbuckets, oldbucket*uintptr(t.bucketsize))) newbit := h.noldbuckets() @@ -1028,14 +1036,6 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) { // TODO: reuse overflow buckets instead of using new ones, if there // is no iterator using the old buckets. (If !oldIterator.) - // evacDst is an evacuation destination. - type evacDst struct { - b *bmap // current destination bucket - i int // key/val index into b - k unsafe.Pointer // pointer to current key storage - v unsafe.Pointer // pointer to current value storage - } - // xy contains the x and y (low and high) evacuation destinations. var xy [2]evacDst x := &xy[0] -- 2.50.0