aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/proc.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-08-29 16:41:08 -0400
committerRuss Cox <rsc@golang.org>2014-08-29 16:41:08 -0400
commit858c57f5bd2170abe71cbbf505966cd648935d00 (patch)
tree479223dc455f81fd393cc40717d85c588a675edc /src/pkg/runtime/proc.c
parent3a7f6646cfdc19ca4f33efe48d33eb1731b49ca8 (diff)
downloadgo-858c57f5bd2170abe71cbbf505966cd648935d00.tar.xz
runtime: make allp a static array
It is anyway, just an allocated one. Giving it a sized type makes Go access nicer. LGTM=iant R=dvyukov, iant CC=golang-codereviews https://golang.org/cl/139960043
Diffstat (limited to 'src/pkg/runtime/proc.c')
-rw-r--r--src/pkg/runtime/proc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index d91a829c15..666adfb7db 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -62,10 +62,6 @@ struct Sched {
enum
{
- // The max value of GOMAXPROCS.
- // There are no fundamental restrictions on the value.
- MaxGomaxprocs = 1<<8,
-
// Number of goroutine ids to grab from runtime·sched.goidgen to local per-P cache at once.
// 16 seems to provide enough amortization, but other than that it's mostly arbitrary number.
GoidCacheBatch = 16,
@@ -80,6 +76,7 @@ G runtime·g0; // idle goroutine for m0
G* runtime·lastg;
M* runtime·allm;
M* runtime·extram;
+P* runtime·allp[MaxGomaxprocs+1];
int8* runtime·goos;
int32 runtime·ncpu;
static int32 newprocs;
@@ -180,7 +177,6 @@ runtime·schedinit(void)
n = MaxGomaxprocs;
procs = n;
}
- runtime·allp = runtime·mallocgc((MaxGomaxprocs+1)*sizeof(runtime·allp[0]), nil, 0);
procresize(procs);
runtime·copystack = runtime·precisestack;