runtime: merge mallocgc, gomallocgc

I assumed they were the same when I wrote
cgocallback.go earlier today. Merge them
to eliminate confusion.

I can't tell what gomallocgc did before with
a nil type but without FlagNoScan.
I created a call like that in cgocallback.go
this morning, translating from a C file.
It was supposed to do what the C version did,
namely treat the block conservatively.
Now it will.

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/141810043
This commit is contained in:
Russ Cox 2014-09-09 01:08:34 -04:00
parent 0f99a91bb5
commit bffb0590c1
13 changed files with 33 additions and 44 deletions

View file

@ -147,7 +147,7 @@ func newdefer(siz int32) *_defer {
if d == nil {
// deferpool is empty or just a big defer
total := goroundupsize(totaldefersize(uintptr(siz)))
d = (*_defer)(gomallocgc(total, conservative, 0))
d = (*_defer)(mallocgc(total, conservative, 0))
}
d.siz = siz
d.special = false