summaryrefslogtreecommitdiff
path: root/test/recover2.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-12-12 22:22:09 -0500
committerRuss Cox <rsc@golang.org>2011-12-12 22:22:09 -0500
commit0203a12ce11f1358c9ce0b75c87e0d5f23980b30 (patch)
tree8896aafad99b6a73ad415620366c9de0b2200997 /test/recover2.go
parentfa93a5f699b13659baae22b0ae24fd6ae11bd41d (diff)
downloadgo-0203a12ce11f1358c9ce0b75c87e0d5f23980b30.tar.gz
gc: implement == on structs and arrays
To allow these types as map keys, we must fill in equal and hash functions in their algorithm tables. Structs or arrays that are "just memory", like [2]int, can and do continue to use the AMEM algorithm. Structs or arrays that contain special values like strings or interface values use generated functions for both equal and hash. The runtime helper func runtime.equal(t, x, y) bool handles the general equality case for x == y and calls out to the equal implementation in the algorithm table. For short values (<= 4 struct fields or array elements), the sequence of elementwise comparisons is inlined instead of calling runtime.equal. R=ken, mpimenov CC=golang-dev http://codereview.appspot.com/5451105
Diffstat (limited to 'test/recover2.go')
-rw-r--r--test/recover2.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/recover2.go b/test/recover2.go
index ccaf8ced1..b5db6f0d1 100644
--- a/test/recover2.go
+++ b/test/recover2.go
@@ -60,6 +60,7 @@ func test4() {
type T struct {
a, b int
+ c []int
}
func test5() {