diff options
author | Keith Randall <khr@golang.org> | 2016-04-19 19:35:10 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2016-04-20 14:02:22 +0000 |
commit | 001e8e8070e8ed3a578dbad93cc3f70257e965bd (patch) | |
tree | 13300d3f022b1d24571be6c267979e5d8d0c48e5 /src/runtime/chan.go | |
parent | 731531980a36f1fa6434c947c54daf8ba530a65f (diff) | |
download | go-001e8e8070e8ed3a578dbad93cc3f70257e965bd.tar.gz go-001e8e8070e8ed3a578dbad93cc3f70257e965bd.zip |
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>
Diffstat (limited to 'src/runtime/chan.go')
-rw-r--r-- | src/runtime/chan.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/chan.go b/src/runtime/chan.go index 8543cb4c9c..3fb0236785 100644 --- a/src/runtime/chan.go +++ b/src/runtime/chan.go @@ -74,7 +74,7 @@ func makechan(t *chantype, size int64) *hchan { // buf points into the same allocation, elemtype is persistent. // SudoG's are referenced from their owning thread so they can't be collected. // TODO(dvyukov,rlh): Rethink when collector can move allocated objects. - c = (*hchan)(mallocgc(hchanSize+uintptr(size)*elem.size, nil, flagNoScan)) + c = (*hchan)(mallocgc(hchanSize+uintptr(size)*elem.size, nil, true)) if size > 0 && elem.size != 0 { c.buf = add(unsafe.Pointer(c), hchanSize) } else { |