diff options
| author | Russ Cox <rsc@golang.org> | 2014-09-03 11:35:22 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-09-03 11:35:22 -0400 |
| commit | 012ceed914a24470207d602deeda3d6642787b4c (patch) | |
| tree | 19df2c9f42be35852034d67b010d98ca923d9123 /src/pkg/runtime/heapdump.c | |
| parent | 7ba41e99728d9a4545361ddfd834a473b424bbb6 (diff) | |
| download | go-012ceed914a24470207d602deeda3d6642787b4c.tar.xz | |
runtime: make onM and mcall take Go func values
This gives them correct types in Go and also makes it
possible to use them to run Go code on an m stack.
LGTM=iant
R=golang-codereviews, dave, iant
CC=dvyukov, golang-codereviews, khr, r
https://golang.org/cl/137970044
Diffstat (limited to 'src/pkg/runtime/heapdump.c')
| -rw-r--r-- | src/pkg/runtime/heapdump.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pkg/runtime/heapdump.c b/src/pkg/runtime/heapdump.c index 63ffe68066..83c2be2ac7 100644 --- a/src/pkg/runtime/heapdump.c +++ b/src/pkg/runtime/heapdump.c @@ -746,6 +746,8 @@ mdump(G *gp) void runtime∕debug·WriteHeapDump(uintptr fd) { + void (*fn)(G*); + // Stop the world. runtime·semacquire(&runtime·worldsema, false); g->m->gcing = 1; @@ -762,7 +764,8 @@ runtime∕debug·WriteHeapDump(uintptr fd) // Call dump routine on M stack. runtime·casgstatus(g, Grunning, Gwaiting); g->waitreason = runtime·gostringnocopy((byte*)"dumping heap"); - runtime·mcall(mdump); + fn = mdump; + runtime·mcall(&fn); // Reset dump file. dumpfd = 0; |
