aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/proc.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-01 18:51:12 -0400
committerRuss Cox <rsc@golang.org>2014-09-01 18:51:12 -0400
commit548d0805f738c5f4d5bb7e72334b80c2acff059d (patch)
tree46e6202941a339e08fe7d57553fa9a0957add949 /src/pkg/runtime/proc.c
parent60be96217d4192312295c89731ab1239a73235e7 (diff)
downloadgo-548d0805f738c5f4d5bb7e72334b80c2acff059d.tar.xz
runtime: convert mprof.goc to mprof.go
The exported Go definitions appearing in mprof.go are copied verbatim from debug.go. The unexported Go funcs and types are new. The C Bucket type used a union and was not a line-for-line translation. LGTM=remyoudompheng R=golang-codereviews, remyoudompheng CC=dvyukov, golang-codereviews, iant, khr, r https://golang.org/cl/137040043
Diffstat (limited to 'src/pkg/runtime/proc.c')
-rw-r--r--src/pkg/runtime/proc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index 666adfb7db..9143fcf596 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -83,6 +83,7 @@ static int32 newprocs;
static Mutex allglock; // the following vars are protected by this lock or by stoptheworld
G** runtime·allg;
+Slice runtime·allgs;
uintptr runtime·allglen;
static uintptr allgcap;
ForceGCState runtime·forcegc;
@@ -2131,9 +2132,12 @@ allgadd(G *gp)
if(runtime·allg != nil)
runtime·memmove(new, runtime·allg, runtime·allglen*sizeof(new[0]));
runtime·allg = new;
+ runtime·allgs.array = (void*)runtime·allg;
allgcap = cap;
+ runtime·allgs.cap = allgcap;
}
runtime·allg[runtime·allglen++] = gp;
+ runtime·allgs.len = runtime·allglen;
runtime·unlock(&allglock);
}