aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/proc.c
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2014-06-30 18:59:24 -0700
committerKeith Randall <khr@golang.org>2014-06-30 18:59:24 -0700
commit7c13860cd08352e785002cb97bd3baafd370e8bc (patch)
tree326e70940dba8dfd140cc67d69461d3e9ef488e6 /src/pkg/runtime/proc.c
parent54951023cb0a1743f7f3cb233ff424593bf1a131 (diff)
downloadgo-7c13860cd08352e785002cb97bd3baafd370e8bc.tar.xz
runtime: stack allocator, separate from mallocgc
In order to move malloc to Go, we need to have a separate stack allocator. If we run out of stack during malloc, malloc will not be available to allocate a new stack. Stacks are the last remaining FlagNoGC objects in the GC heap. Once they are out, we can get rid of the distinction between the allocated/blockboundary bits. (This will be in a separate change.) Fixes #7468 Fixes #7424 LGTM=rsc, dvyukov R=golang-codereviews, dvyukov, khr, dave, rsc CC=golang-codereviews https://golang.org/cl/104200047
Diffstat (limited to 'src/pkg/runtime/proc.c')
-rw-r--r--src/pkg/runtime/proc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index 04808f2c50..ccaddee2eb 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -152,6 +152,7 @@ runtime·schedinit(void)
runtime·precisestack = true; // haveexperiment("precisestack");
runtime·symtabinit();
+ runtime·stackinit();
runtime·mallocinit();
mcommoninit(g->m);
@@ -1926,7 +1927,7 @@ gfput(P *p, G *gp)
runtime·throw("gfput: bad stacksize");
}
top = (Stktop*)gp->stackbase;
- if(top->malloced) {
+ if(stksize != FixedStack) {
// non-standard stack size - free it.
runtime·stackfree(gp, (void*)gp->stack0, top);
gp->stack0 = 0;