]> Cypherpunks repositories - gostls13.git/commit
reflect: mark mapassign as noescape
authorKeith Randall <khr@golang.org>
Wed, 18 Nov 2015 19:13:19 +0000 (11:13 -0800)
committerKeith Randall <khr@golang.org>
Thu, 19 Nov 2015 21:35:58 +0000 (21:35 +0000)
commit8d31a86a1e7be5f84af9df8aeb36bc1e157d50eb
tree0b5f2a1f7fb677450aa03738adb5a893b3ea1c44
parent476aa95015326371d7863cb4c9d4a9850c326236
reflect: mark mapassign as noescape

The lack of this annotation causes Value.SetMapIndex to allocate
when it doesn't need to.

Add comments about why it's safe to do so.

Add a test to make sure we stay allocation-free.

Change-Id: I00826e0d73e317a31bdeae5c7e46bf95b0c6ae6a
Reviewed-on: https://go-review.googlesource.com/17060
Reviewed-by: David Chase <drchase@google.com>
src/reflect/all_test.go
src/reflect/value.go