diff options
Diffstat (limited to 'src/runtime/map.go')
-rw-r--r-- | src/runtime/map.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/map.go b/src/runtime/map.go index 8be1d3991d..5ac3a9958b 100644 --- a/src/runtime/map.go +++ b/src/runtime/map.go @@ -599,7 +599,7 @@ again: if h.growing() { growWork(t, h, bucket) } - b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize))) + b := (*bmap)(add(h.buckets, bucket*uintptr(t.bucketsize))) top := tophash(hash) var inserti *uint8 @@ -650,7 +650,7 @@ bucketloop: } if inserti == nil { - // all current buckets are full, allocate a new one. + // The current bucket and all the overflow buckets connected to it are full, allocate a new one. newb := h.newoverflow(t, b) inserti = &newb.tophash[0] insertk = add(unsafe.Pointer(newb), dataOffset) @@ -1380,5 +1380,5 @@ func reflectlite_maplen(h *hmap) int { return h.count } -const maxZero = 1024 // must match value in cmd/compile/internal/gc/walk.go:zeroValSize +const maxZero = 1024 // must match value in reflect/value.go:maxZero cmd/compile/internal/gc/walk.go:zeroValSize var zeroVal [maxZero]byte |