]> Cypherpunks repositories - gostls13.git/commit
runtime: use typedmemclr for typed memory
authorAustin Clements <austin@google.com>
Mon, 17 Oct 2016 21:00:05 +0000 (17:00 -0400)
committerAustin Clements <austin@google.com>
Fri, 28 Oct 2016 18:20:04 +0000 (18:20 +0000)
commitaa581f51570b1c35dc2648226fd8de861de526d4
treee94aab60525446ca1058b5f62240b1d92c068309
parenta475a38a3dcd48541f60e40b1dac3c84ab72d0e5
runtime: use typedmemclr for typed memory

The hybrid barrier requires distinguishing typed and untyped memory
even when zeroing because the *current* contents of the memory matters
even when overwriting.

This commit introduces runtime.typedmemclr and runtime.memclrHasPointers
as a typed memory clearing functions parallel to runtime.typedmemmove.
Currently these simply call memclr, but with the hybrid barrier we'll
need to shade any pointers we're overwriting. These will provide us
with the necessary hooks to do so.

Updates #17503.

Change-Id: I74478619f8907825898092aaa204d6e4690f27e6
Reviewed-on: https://go-review.googlesource.com/31366
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/reflect/value.go
src/runtime/chan.go
src/runtime/hashmap.go
src/runtime/iface.go
src/runtime/mbarrier.go
src/runtime/select.go
src/runtime/stubs.go