]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: update comment on stack allocator
authorDmitriy Vyukov <dvyukov@google.com>
Sat, 25 May 2013 18:47:36 +0000 (22:47 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Sat, 25 May 2013 18:47:36 +0000 (22:47 +0400)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9665046

src/pkg/runtime/stack.c

index e9a35672f589d4b471ea2f7f25019a1c2519a2c3..b6f64aa7664864363fc70da6d4a870007aa238b0 100644 (file)
@@ -81,13 +81,10 @@ runtime·stackalloc(uint32 n)
        if(g != m->g0)
                runtime·throw("stackalloc not on scheduler stack");
 
-       // Stack allocator uses malloc/free most of the time,
-       // but if we're in the middle of malloc and need stack,
-       // we have to do something else to avoid deadlock.
-       // In that case, we fall back on a fixed-size free-list
-       // allocator, assuming that inside malloc all the stack
-       // frames are small, so that all the stack allocations
-       // will be a single size, the minimum (right now, 5k).
+       // Stacks are usually allocated with a fixed-size free-list allocator,
+       // but if we need a stack of non-standard size, we fall back on malloc
+       // (assuming that inside malloc and GC all the stack frames are small,
+       // so that we do not deadlock).
        if(n == FixedStack || m->mallocing || m->gcing) {
                if(n != FixedStack) {
                        runtime·printf("stackalloc: in malloc, size=%d want %d\n", FixedStack, n);