diff options
author | Keith Randall <khr@golang.org> | 2019-11-16 07:12:53 -0800 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2019-11-16 20:31:45 +0000 |
commit | 6ba0be16391697bdaab7d8f836b66921977d5474 (patch) | |
tree | 07c3ef892dbce409c21fd4b60652a4d93f9f813d /src/hash | |
parent | c20b71eb37889e7257453be152a994319c76d451 (diff) | |
download | go-6ba0be16391697bdaab7d8f836b66921977d5474.tar.gz go-6ba0be16391697bdaab7d8f836b66921977d5474.zip |
hash/maphash: mark call into runtime hash function as not escaping
This allows maphash.Hash to be allocated on the stack for typical uses.
Fixes #35636
Change-Id: I8366507d26ea717f47a9fb46d3bd69ba799845ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/207444
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/hash')
-rw-r--r-- | src/hash/maphash/maphash.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/hash/maphash/maphash.go b/src/hash/maphash/maphash.go index 9b6c0cfb99..3f406e9db6 100644 --- a/src/hash/maphash/maphash.go +++ b/src/hash/maphash/maphash.go @@ -193,6 +193,7 @@ func rthash(b []byte, seed uint64) uint64 { } //go:linkname runtime_memhash runtime.memhash +//go:noescape func runtime_memhash(p unsafe.Pointer, seed, s uintptr) uintptr // Sum appends the hash's current 64-bit value to b. |