From b2e0e9688a512970ea8d270238c8ff3bbf85cbe1 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Fri, 26 Aug 2016 15:41:51 -0400 Subject: cmd/compile: remove Zero and NilCheck for newobject Recognize runtime.newobject and don't Zero or NilCheck it. Fixes #15914 (?) Updates #15390. TBD: add test Change-Id: Ia3bfa5c2ddbe2c27c92d9f68534a713b5ce95934 Reviewed-on: https://go-review.googlesource.com/27930 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- src/runtime/malloc.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/runtime/malloc.go') diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index 38c7a3b847..7d7f9e11d3 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -781,6 +781,8 @@ func largeAlloc(size uintptr, needzero bool) *mspan { } // implementation of new builtin +// compiler (both frontend and SSA backend) knows the signature +// of this function func newobject(typ *_type) unsafe.Pointer { return mallocgc(typ.size, typ, true) } -- cgit v1.3