Commit 248a7c7c authored by Martin Möhrmann's avatar Martin Möhrmann

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: 's avatarKeith Randall <khr@golang.org>
parent 7df29b50
...@@ -542,7 +542,7 @@ func mapassign(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer { ...@@ -542,7 +542,7 @@ func mapassign(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer {
h.flags |= hashWriting h.flags |= hashWriting
if h.buckets == nil { if h.buckets == nil {
h.buckets = newarray(t.bucket, 1) h.buckets = newobject(t.bucket) // newarray(t.bucket, 1)
} }
again: again:
......
...@@ -426,7 +426,7 @@ func mapassign_fast32(t *maptype, h *hmap, key uint32) unsafe.Pointer { ...@@ -426,7 +426,7 @@ func mapassign_fast32(t *maptype, h *hmap, key uint32) unsafe.Pointer {
h.flags |= hashWriting h.flags |= hashWriting
if h.buckets == nil { if h.buckets == nil {
h.buckets = newarray(t.bucket, 1) h.buckets = newobject(t.bucket) // newarray(t.bucket, 1)
} }
again: again:
...@@ -514,7 +514,7 @@ func mapassign_fast64(t *maptype, h *hmap, key uint64) unsafe.Pointer { ...@@ -514,7 +514,7 @@ func mapassign_fast64(t *maptype, h *hmap, key uint64) unsafe.Pointer {
h.flags |= hashWriting h.flags |= hashWriting
if h.buckets == nil { if h.buckets == nil {
h.buckets = newarray(t.bucket, 1) h.buckets = newobject(t.bucket) // newarray(t.bucket, 1)
} }
again: again:
...@@ -603,7 +603,7 @@ func mapassign_faststr(t *maptype, h *hmap, ky string) unsafe.Pointer { ...@@ -603,7 +603,7 @@ func mapassign_faststr(t *maptype, h *hmap, ky string) unsafe.Pointer {
h.flags |= hashWriting h.flags |= hashWriting
if h.buckets == nil { if h.buckets == nil {
h.buckets = newarray(t.bucket, 1) h.buckets = newobject(t.bucket) // newarray(t.bucket, 1)
} }
again: again:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment