]> Cypherpunks repositories - gostls13.git/commit
reflect: avoid allocation when interface's contents are not addressable
authorRob Pike <r@golang.org>
Fri, 9 Aug 2013 00:49:01 +0000 (10:49 +1000)
committerRob Pike <r@golang.org>
Fri, 9 Aug 2013 00:49:01 +0000 (10:49 +1000)
commit94179d61abf9516e24597ec8fa3888343d01388c
treecba24565b3c630e75f67d9b6d862a2882cf6723f
parentd2bff757f6043d9a6f61616ac7dd78ca30442cb4
reflect: avoid allocation when interface's contents are not addressable
See issue 4949 for a full explanation.

Allocs go from 1 to zero in the non-addressable case.
Fixes #4949.

BenchmarkInterfaceBig             90           14  -84.01%
BenchmarkInterfaceSmall           14           14   +0.00%

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12646043
src/pkg/reflect/all_test.go
src/pkg/reflect/value.go