]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: move gosched to Go, to add stack frame information
authorRuss Cox <rsc@golang.org>
Thu, 11 Sep 2014 20:22:21 +0000 (16:22 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 11 Sep 2014 20:22:21 +0000 (16:22 -0400)
LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/134520044

src/runtime/malloc.go
src/runtime/mgc0.go
src/runtime/proc.c
src/runtime/runtime.h
src/runtime/stubs.go

index 890ddea6d5c0ca4e00c35425ecf13c3d226ca767..d6f1a1a4a2b282e2ad0e704facb6099c4eee525c 100644 (file)
@@ -477,7 +477,7 @@ func gogc(force int32) {
        // now that gc is done, kick off finalizer thread if needed
        if !concurrentSweep {
                // give the queued finalizers, if any, a chance to run
-               gosched()
+               Gosched()
        }
 }
 
index 5d6d91875f8975d05ff720e85490546b483c7707..130e8262adc72602427c9e01e821762607917258 100644 (file)
@@ -89,7 +89,7 @@ func bgsweep() {
        for {
                for gosweepone() != ^uintptr(0) {
                        sweep.nbgsweep++
-                       gosched()
+                       Gosched()
                }
                lock(&gclock)
                if !gosweepdone() {
index 03deb7abb1e3054cc4b939ba3b41c1c618d65297..004d93a97384b84ca64c1316da615a9bc0c12b7e 100644 (file)
@@ -1677,18 +1677,7 @@ runtime·park_m(G *gp)
        schedule();
 }
 
-// Scheduler yield.
-#pragma textflag NOSPLIT
-void
-runtime·gosched(void)
-{
-       void (*fn)(G*);
-       
-       fn = runtime·gosched_m;
-       runtime·mcall(&fn);
-}
-
-// runtime·gosched continuation on g0.
+// Gosched continuation on g0.
 void
 runtime·gosched_m(G *gp)
 {
index 4f9656457d091273e9331664a667e15a0b4399bf..01923c61e010cb295629e974e7c03c5ccc46e0d8 100644 (file)
@@ -852,7 +852,6 @@ void        runtime·setg(G*);
 void   runtime·newextram(void);
 void   runtime·exit(int32);
 void   runtime·breakpoint(void);
-void   runtime·gosched(void);
 void   runtime·gosched_m(G*);
 void   runtime·schedtrace(bool);
 void   runtime·park(bool(*)(G*, void*), void*, String);
index 45fc877e51a04095eb4438a3170d91cf3b73165b..ff443c4cd4b2c85fe148ae6748655b79e69416ba 100644 (file)
@@ -130,7 +130,6 @@ func memclr(ptr unsafe.Pointer, n uintptr)
 //go:noescape
 func memmove(to unsafe.Pointer, from unsafe.Pointer, n uintptr)
 
-func gosched()
 func starttheworld()
 func stoptheworld()
 func newextram()