Change memory allocation accounting for stacks to use stacks_sys,
since that seems to be what it is for.
Reviewed-on: https://go-review.googlesource.com/43297
From-SVN: r247967
-3c1258156a2ae483c5cc523cb7a3c3374cbe7c2c
+d5bfa6cebb19a154cbfbc53f6e647d2ca7adef68
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
// sigset is the Go version of the C type sigset_t.
// _sigset_t is defined by the Makefile from <signal.h>.
type sigset _sigset_t
+
+// getMemstats returns a pointer to the internal memstats variable,
+// for C code.
+//go:linkname getMemstats runtime.getMemstats
+func getMemstats() *mstats {
+ return &memstats
+}
__asm__(GOSYM_PREFIX "runtime.globrunqput");
extern P* pidleget(void)
__asm__(GOSYM_PREFIX "runtime.pidleget");
+extern struct mstats* getMemstats(void)
+ __asm__(GOSYM_PREFIX "runtime.getMemstats");
bool runtime_isstarted;
// 32-bit mode, the Go allocation space is all of
// memory anyhow.
if(sizeof(void*) == 8) {
- void *p = runtime_sysAlloc(stacksize, &mstats()->other_sys);
+ void *p = runtime_sysAlloc(stacksize, &getMemstats()->stacks_sys);
if(p == nil)
runtime_throw("runtime: cannot allocate memory for goroutine stack");
*ret_stack = (byte*)p;
scanstackblock(sp, (uintptr)(spsize), gcw);
}
#else
- M *mp;
byte* bottom;
byte* top;