aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/hashmap.go
diff options
context:
space:
mode:
authorMartin Möhrmann <moehrmann@google.com>2017-08-10 21:24:51 +0200
committerMartin Möhrmann <moehrmann@google.com>2017-08-14 21:25:02 +0000
commit248a7c7c42eaf58d0c82b704205c7eac5b14a42a (patch)
tree24935876f7e0c504edb79b4ba496f2ded38036c0 /src/runtime/hashmap.go
parent7df29b50b2d7fd9abcd2a070df407db57f3f79a6 (diff)
downloadgo-248a7c7c42eaf58d0c82b704205c7eac5b14a42a.tar.xz
runtime: replace some uses of newarray with newobject for maps
This avoids the never triggered capacity checks in newarray. Change-Id: Ib72b204adcb9e3fd3ab963defe0cd40e22d5d492 Reviewed-on: https://go-review.googlesource.com/54731 Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/hashmap.go')
-rw-r--r--src/runtime/hashmap.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go
index d9e5d96207..87d0d26cfa 100644
--- a/src/runtime/hashmap.go
+++ b/src/runtime/hashmap.go
@@ -542,7 +542,7 @@ func mapassign(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer {
h.flags |= hashWriting
if h.buckets == nil {
- h.buckets = newarray(t.bucket, 1)
+ h.buckets = newobject(t.bucket) // newarray(t.bucket, 1)
}
again: