]> Cypherpunks repositories - gostls13.git/commit
hash/crc32: add noescape tags to assembly functions
authorJoe Tsai <joetsai@digital-static.net>
Fri, 20 Nov 2015 01:41:57 +0000 (17:41 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 25 Nov 2015 15:01:10 +0000 (15:01 +0000)
commit64cc5fd0b3ad20c6e7e8b875317629df8207d9ba
tree8776f5546db4e409aa479c6a342a873aed73babd
parente5956bca418bb8528509665ae753eada2024b9e3
hash/crc32: add noescape tags to assembly functions

CRC-32 computation is stateless and the p slice does not get stored
anywhere. Thus, we mark the assembly functions as noescape so that
it doesn't believe that p leaks in:
func Update(crc uint32, tab *Table, p []byte) uint32

Before:
./crc32.go:153: leaking param: p

After:
./crc32.go:153: Update p does not escape

Change-Id: I52ba35b6cc544fff724327140e0c27898431d1dc
Reviewed-on: https://go-review.googlesource.com/17069
Reviewed-by: Russ Cox <rsc@golang.org>
src/hash/crc32/crc32_amd64.go
src/hash/crc32/crc32_amd64p32.go