From 87e48c5afdcf5e01bb2b7f51b7643e8901f4b7f9 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 17 Oct 2016 18:41:56 -0400 Subject: 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 Reviewed-by: Rick Hudson --- src/runtime/sys_windows_386.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/runtime/sys_windows_386.s') diff --git a/src/runtime/sys_windows_386.s b/src/runtime/sys_windows_386.s index 60302e05c4..bd5de33946 100644 --- a/src/runtime/sys_windows_386.s +++ b/src/runtime/sys_windows_386.s @@ -192,7 +192,7 @@ TEXT runtime·externalthreadhandler(SB),NOSPLIT,$0 SUBL $m__size, SP // space for M MOVL SP, 0(SP) MOVL $m__size, 4(SP) - CALL runtime·memclr(SB) // smashes AX,BX,CX + CALL runtime·memclrNoHeapPointers(SB) // smashes AX,BX,CX LEAL m_tls(SP), CX MOVL CX, 0x14(FS) @@ -203,7 +203,7 @@ TEXT runtime·externalthreadhandler(SB),NOSPLIT,$0 MOVL SP, 0(SP) MOVL $g__size, 4(SP) - CALL runtime·memclr(SB) // smashes AX,BX,CX + CALL runtime·memclrNoHeapPointers(SB) // smashes AX,BX,CX LEAL g__size(SP), BX MOVL BX, g_m(SP) -- cgit v1.3