]> Cypherpunks repositories - gostls13.git/commit
runtime: only clear pointer-containing memory during map delete
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 21 Aug 2017 18:00:31 +0000 (11:00 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 23 Aug 2017 13:53:00 +0000 (13:53 +0000)
commit0c7fd56951cff83bb7b23f64a712327bab154514
tree3447f383850ab210acf8c217b16b94c7ee795fe1
parent29e6bdc69c580cf6e9c4cc27600b7f4e2b0def9f
runtime: only clear pointer-containing memory during map delete

When deleting entries from a map, only clear the key and value
if they contain pointers. And use memclrHasPointers to do so.

While we're here, specialize key clearing in mapdelete_faststr,
and fix another missed usage of add in mapdelete.

Benchmarking impeded by #21546.

Change-Id: I3f6f924f738d6b899b722d6438e9e63f52359b84
Reviewed-on: https://go-review.googlesource.com/57630
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/hashmap.go
src/runtime/hashmap_fast.go