From: Josh Bleecher Snyder Date: Fri, 18 Aug 2017 01:25:54 +0000 (-0700) Subject: runtime: make evacDst a top level type X-Git-Tag: go1.10beta1~1455 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=776c33ee5ed67a00bd05912bd15a7c8062daab88;p=gostls13.git runtime: make evacDst a top level type 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 --- 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]