reflect: mark map access functions as go:noescape
benchmark old allocs new allocs delta
BenchmarkSkipValue 14914 14202 -4.77%
Change-Id: I40e1fe8843cc6a099a2abfcd814ecc2a2d6a5b1f
Reviewed-on: https://go-review.googlesource.com/3744
Reviewed-by: Keith Randall <khr@golang.org>
diff --git a/src/reflect/value.go b/src/reflect/value.go
index 4060206..081c4d9 100644
--- a/src/reflect/value.go
+++ b/src/reflect/value.go
@@ -2439,12 +2439,27 @@
func makechan(typ *rtype, size uint64) (ch unsafe.Pointer)
func makemap(t *rtype) (m unsafe.Pointer)
+
+//go:noescape
func mapaccess(t *rtype, m unsafe.Pointer, key unsafe.Pointer) (val unsafe.Pointer)
+
func mapassign(t *rtype, m unsafe.Pointer, key, val unsafe.Pointer)
+
+//go:noescape
func mapdelete(t *rtype, m unsafe.Pointer, key unsafe.Pointer)
+
+// m escapes into the return value, but the caller of mapiterinit
+// doesn't let the return value escape.
+//go:noescape
func mapiterinit(t *rtype, m unsafe.Pointer) unsafe.Pointer
+
+//go:noescape
func mapiterkey(it unsafe.Pointer) (key unsafe.Pointer)
+
+//go:noescape
func mapiternext(it unsafe.Pointer)
+
+//go:noescape
func maplen(m unsafe.Pointer) int
// call calls fn with a copy of the n argument bytes pointed at by arg.