From: Dmitry Vyukov Date: Tue, 3 Feb 2015 08:54:11 +0000 (+0300) Subject: reflect: mark map access functions as go:noescape X-Git-Tag: go1.5beta1~2057 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=84e256753744e765e4a31b48e2a641eecd4d01f1;p=gostls13.git 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 --- diff --git a/src/reflect/value.go b/src/reflect/value.go index 4060206eac..081c4d9d7b 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -2439,12 +2439,27 @@ func chansend(t *rtype, ch unsafe.Pointer, val unsafe.Pointer, nb bool) bool 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.