diff options
author | Austin Clements <austin@google.com> | 2017-06-13 11:32:17 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2017-09-27 16:29:09 +0000 |
commit | 84d2c7ea835c238f466de64066b65614d1bc7dbe (patch) | |
tree | 79a73176bd18bb496e8505afdcd848b1c1c0b044 /src/runtime/trace.go | |
parent | 197f9ba11d4559cbd19350ca652da7881f4b273f (diff) | |
download | go-84d2c7ea835c238f466de64066b65614d1bc7dbe.tar.gz go-84d2c7ea835c238f466de64066b65614d1bc7dbe.zip |
runtime: dynamically allocate allp
This makes it possible to eliminate the hard cap on GOMAXPROCS.
Updates #15131.
Change-Id: I4c422b340791621584c118a6be1b38e8a44f8b70
Reviewed-on: https://go-review.googlesource.com/45573
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/trace.go')
-rw-r--r-- | src/runtime/trace.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runtime/trace.go b/src/runtime/trace.go index 50e4c73c83..398d0449b4 100644 --- a/src/runtime/trace.go +++ b/src/runtime/trace.go @@ -277,7 +277,9 @@ func StopTrace() { traceGoSched() - for _, p := range &allp { + // Loop over all allocated Ps because dead Ps may still have + // trace buffers. + for _, p := range allp[:cap(allp)] { if p == nil { break } @@ -320,7 +322,7 @@ func StopTrace() { // The lock protects us from races with StartTrace/StopTrace because they do stop-the-world. lock(&trace.lock) - for _, p := range &allp { + for _, p := range allp[:cap(allp)] { if p == nil { break } |