aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/hashmap.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/hashmap.go')
-rw-r--r--src/runtime/hashmap.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go
index e8e61a7fd1..c36ff470d6 100644
--- a/src/runtime/hashmap.go
+++ b/src/runtime/hashmap.go
@@ -1166,10 +1166,12 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) {
b = (*bmap)(add(h.oldbuckets, oldbucket*uintptr(t.bucketsize)))
// Preserve b.tophash because the evacuation
// state is maintained there.
+ ptr := add(unsafe.Pointer(b), dataOffset)
+ n := uintptr(t.bucketsize) - dataOffset
if t.bucket.kind&kindNoPointers == 0 {
- memclrHasPointers(add(unsafe.Pointer(b), dataOffset), uintptr(t.bucketsize)-dataOffset)
+ memclrHasPointers(ptr, n)
} else {
- memclrNoHeapPointers(add(unsafe.Pointer(b), dataOffset), uintptr(t.bucketsize)-dataOffset)
+ memclrNoHeapPointers(ptr, n)
}
}
}