diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2013-07-26 21:17:24 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2013-07-26 21:17:24 +0400 |
| commit | f8a850b250655bd26f5da4cfe7299b4a32be28fa (patch) | |
| tree | 8337d4705585d9f8391110098d1d57816ab4d9cf /src/pkg/runtime/proc.c | |
| parent | a0f74093b2f3aa0d8d2b69c881a75f40d296355f (diff) | |
| download | go-f8a850b250655bd26f5da4cfe7299b4a32be28fa.tar.xz | |
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
Diffstat (limited to 'src/pkg/runtime/proc.c')
| -rw-r--r-- | src/pkg/runtime/proc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 0e9785e456..135a112f52 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -1941,7 +1941,7 @@ procresize(int32 new) for(i = 0; i < new; i++) { p = runtime·allp[i]; if(p == nil) { - p = (P*)runtime·mallocgc(sizeof(*p), 0, 0, 1); + p = (P*)runtime·mallocgc(sizeof(*p), 0, FlagNoInvokeGC); p->status = Pgcstop; runtime·atomicstorep(&runtime·allp[i], p); } @@ -1953,7 +1953,7 @@ procresize(int32 new) } if(p->runq == nil) { p->runqsize = 128; - p->runq = (G**)runtime·mallocgc(p->runqsize*sizeof(G*), 0, 0, 1); + p->runq = (G**)runtime·mallocgc(p->runqsize*sizeof(G*), 0, FlagNoInvokeGC); } } |
