mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: refactor mallocgc
Make it accept type, combine flags. Several reasons for the change: 1. mallocgc and settype must be atomic wrt GC 2. settype is called from only one place now 3. it will help performance (eventually settype functionality must be combined with markallocated) 4. flags are easier to read now (no mallocgc(sz, 0, 1, 0) anymore) R=golang-dev, iant, nightlyone, rsc, dave, khr, bradfitz, r CC=golang-dev https://golang.org/cl/10136043
This commit is contained in:
parent
a0f74093b2
commit
f8a850b250
9 changed files with 62 additions and 119 deletions
|
|
@ -105,7 +105,7 @@ runtime·stackalloc(uint32 n)
|
|||
m->stackinuse++;
|
||||
return v;
|
||||
}
|
||||
return runtime·mallocgc(n, FlagNoProfiling|FlagNoGC, 0, 0);
|
||||
return runtime·mallocgc(n, 0, FlagNoProfiling|FlagNoGC|FlagNoZero|FlagNoInvokeGC);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue