]> Cypherpunks repositories - gostls13.git/commit
runtime, cmd/compile: rename memclr -> memclrNoHeapPointers
authorAustin Clements <austin@google.com>
Mon, 17 Oct 2016 22:41:56 +0000 (18:41 -0400)
committerAustin Clements <austin@google.com>
Fri, 28 Oct 2016 18:20:33 +0000 (18:20 +0000)
commit87e48c5afdcf5e01bb2b7f51b7643e8901f4b7f9
tree4c60e60c8bdb95c6d7a20fa4b9bada08805d0fdc
parentae3bb4a537c84e43be2ed7b79e84450332aafe2d
runtime, cmd/compile: rename memclr -> memclrNoHeapPointers

Since barrier-less memclr is only safe in very narrow circumstances,
this commit renames memclr to avoid accidentally calling memclr on
typed memory. This can cause subtle, non-deterministic bugs, so it's
worth some effort to prevent. In the near term, this will also prevent
bugs creeping in from any concurrent CLs that add calls to memclr; if
this happens, whichever patch hits master second will fail to compile.

This also adds the other new memclr variants to the compiler's
builtin.go to minimize the churn on that binary blob. We'll use these
in future commits.

Updates #17503.

Change-Id: I00eead049f5bd35ca107ea525966831f3d1ed9ca
Reviewed-on: https://go-review.googlesource.com/31369
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
33 files changed:
src/cmd/compile/internal/gc/builtin.go
src/cmd/compile/internal/gc/builtin/runtime.go
src/cmd/compile/internal/gc/range.go
src/reflect/value.go
src/runtime/alg.go
src/runtime/asm_amd64p32.s
src/runtime/export_test.go
src/runtime/hashmap.go
src/runtime/heapdump.go
src/runtime/malloc.go
src/runtime/mbarrier.go
src/runtime/mbitmap.go
src/runtime/mem_plan9.go
src/runtime/memclr_386.s
src/runtime/memclr_amd64.s
src/runtime/memclr_arm.s
src/runtime/memclr_arm64.s
src/runtime/memclr_mips64x.s
src/runtime/memclr_plan9_386.s
src/runtime/memclr_plan9_amd64.s
src/runtime/memclr_ppc64x.s
src/runtime/memclr_s390x.s
src/runtime/mfixalloc.go
src/runtime/mheap.go
src/runtime/os3_solaris.go
src/runtime/proc.go
src/runtime/slice.go
src/runtime/stack.go
src/runtime/string.go
src/runtime/stubs.go
src/runtime/sys_windows_386.s
src/runtime/sys_windows_amd64.s
src/runtime/write_err_android.go