runtime: simplify mallocgc flag argument

mallocgc can calculate noscan itself.  The only remaining
flag argument is needzero, so we just make that a boolean arg.

Fixes #15379

Change-Id: I839a70790b2a0c9dbcee2600052bfbd6c8148e20
Reviewed-on: https://go-review.googlesource.com/22290
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Keith Randall 2016-04-19 19:35:10 -07:00
parent 731531980a
commit 001e8e8070
8 changed files with 23 additions and 54 deletions

View file

@ -205,7 +205,7 @@ func newdefer(siz int32) *_defer {
if d == nil {
// Allocate new defer+args.
total := roundupsize(totaldefersize(uintptr(siz)))
d = (*_defer)(mallocgc(total, deferType, 0))
d = (*_defer)(mallocgc(total, deferType, true))
}
d.siz = siz
gp := mp.curg