diff options
| author | Russ Cox <rsc@golang.org> | 2014-08-29 16:41:08 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-08-29 16:41:08 -0400 |
| commit | 858c57f5bd2170abe71cbbf505966cd648935d00 (patch) | |
| tree | 479223dc455f81fd393cc40717d85c588a675edc /src/pkg/runtime/runtime.h | |
| parent | 3a7f6646cfdc19ca4f33efe48d33eb1731b49ca8 (diff) | |
| download | go-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/runtime.h')
| -rw-r--r-- | src/pkg/runtime/runtime.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index 27b945e979..3f03a4da06 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -422,6 +422,12 @@ struct P byte pad[64]; }; +enum { + // The max value of GOMAXPROCS. + // There are no fundamental restrictions on the value. + MaxGomaxprocs = 1<<8, +}; + // The m->locked word holds two pieces of state counting active calls to LockOSThread/lockOSThread. // The low bit (LockExternal) is a boolean reporting whether any LockOSThread call is active. // External locks are not recursive; a second lock is silently ignored. @@ -768,7 +774,7 @@ extern G** runtime·allg; extern uintptr runtime·allglen; extern G* runtime·lastg; extern M* runtime·allm; -extern P** runtime·allp; +extern P* runtime·allp[MaxGomaxprocs+1]; extern int32 runtime·gomaxprocs; extern uint32 runtime·needextram; extern uint32 runtime·panicking; |
