From fa897643a18d71a62bade50f80171f5e58449f5a Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Sat, 20 Aug 2016 18:36:27 +0100 Subject: [PATCH] runtime: remove unnecessary calls to memclr Go will have already cleared the structs (the original C wouldn't have). Change-Id: I4a5a0cfd73953181affc158d188aae2ce281bb33 Reviewed-on: https://go-review.googlesource.com/27435 Run-TryBot: Michael Munday Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/runtime/os_linux.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go index 542f214a42..0131c6687d 100644 --- a/src/runtime/os_linux.go +++ b/src/runtime/os_linux.go @@ -388,7 +388,6 @@ func osyield() //go:nowritebarrierrec func setsig(i int32, fn uintptr, restart bool) { var sa sigactiont - memclr(unsafe.Pointer(&sa), unsafe.Sizeof(sa)) sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTORER if restart { sa.sa_flags |= _SA_RESTART @@ -431,8 +430,6 @@ func setsigstack(i int32) { //go:nowritebarrierrec func getsig(i int32) uintptr { var sa sigactiont - - memclr(unsafe.Pointer(&sa), unsafe.Sizeof(sa)) if rt_sigaction(uintptr(i), nil, &sa, unsafe.Sizeof(sa.sa_mask)) != 0 { throw("rt_sigaction read failure") } -- 2.48.1