tr := &Transport{}
c := &Client{Transport: tr}
- n0 := runtime.Goroutines()
+ n0 := runtime.NumGoroutine()
const numReq = 25
didReqCh := make(chan bool)
<-gotReqCh
}
- nhigh := runtime.Goroutines()
+ nhigh := runtime.NumGoroutine()
// Tell all handlers to unblock and reply.
for i := 0; i < numReq; i++ {
time.Sleep(100 * time.Millisecond)
runtime.GC()
runtime.GC() // even more.
- nfinal := runtime.Goroutines()
+ nfinal := runtime.NumGoroutine()
growth := nfinal - n0
}
void
-runtime·Cgocalls(int64 ret)
+runtime·NumCgoCall(int64 ret)
{
M *m;
// NumCPU returns the number of logical CPUs on the local machine.
func NumCPU() int
-// Cgocalls returns the number of cgo calls made by the current process.
-func Cgocalls() int64
+// NumCgoCall returns the number of cgo calls made by the current process.
+func NumCgoCall() int64
-// Goroutines returns the number of goroutines that currently exist.
-func Goroutines() int32
+// NumGoroutine returns the number of goroutines that currently exist.
+func NumGoroutine() int32
// Alloc allocates a block of the given size.
// FOR TESTING AND DEBUGGING ONLY.
return theVersion
}
-// GOOS is the Go tree's operating system target:
+// GOOS is the running program's operating system target:
// one of darwin, freebsd, linux, and so on.
const GOOS string = theGoos
-// GOARCH is the Go tree's architecture target:
+// GOARCH is the running program's architecture target:
// 386, amd64, or arm.
const GOARCH string = theGoarch
// Add to runtime·allm so garbage collector doesn't free m
// when it is just in a register or thread-local storage.
m->alllink = runtime·allm;
- // runtime·Cgocalls() iterates over allm w/o schedlock,
+ // runtime·NumCgoCall() iterates over allm w/o schedlock,
// so we need to publish it safely.
runtime·atomicstorep(&runtime·allm, m);
}
}
void
-runtime·Goroutines(int32 ret)
+runtime·NumGoroutine(int32 ret)
{
ret = runtime·sched.gcount;
FLUSH(&ret);