]> Cypherpunks repositories - gostls13.git/commit
cmd/compile, runtime: stop returning t.zero on hashmap miss
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Fri, 21 Aug 2015 02:54:55 +0000 (14:54 +1200)
committerIan Lance Taylor <iant@golang.org>
Wed, 26 Aug 2015 00:03:21 +0000 (00:03 +0000)
commit38519e69d05e21909e12f6149beb3fbd3808b3f3
treee04772f83ce8d7af1d37f62d9d79d102c35b1ff2
parent79a3d239e99d8e60324701d313969cb6611bf308
cmd/compile, runtime: stop returning t.zero on hashmap miss

Previously t.zero always pointed to runtime.zerovalue. Change the hashmap code
to always return a runtime pointer directly, and change that pointer to point
to a larger buffer if one is needed.

(It might be better to only copy from the pointer returned by the mapaccess
functions when the value type is small enough and have the compiler insert
explicit zeroing for larger value types, but I tried and failed to do this).

This removes all uses of the zero field of the type data; the field itself can
be removed in a separate change.

Fixes #11491

Change-Id: I5b81752ff4067d74a5a281c41e88f151bae0171e
Reviewed-on: https://go-review.googlesource.com/13784
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/gc/reflect.go
src/cmd/compile/internal/gc/walk.go
src/reflect/type.go
src/runtime/hashmap.go
src/runtime/hashmap_fast.go
src/runtime/type.go