diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2013-05-25 22:47:36 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2013-05-25 22:47:36 +0400 |
| commit | 46137f227bd11777f535271e842eac14fc65fd1c (patch) | |
| tree | 6e298338c828fa5eb3a2e58aeb0bcaf2776c7b8d /src/pkg/runtime/stack.c | |
| parent | a2ec8abd2d1f6b1ac0cdbfc4a66677308f6a5cd9 (diff) | |
| download | go-46137f227bd11777f535271e842eac14fc65fd1c.tar.xz | |
runtime: update comment on stack allocator
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9665046
Diffstat (limited to 'src/pkg/runtime/stack.c')
| -rw-r--r-- | src/pkg/runtime/stack.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c index e9a35672f5..b6f64aa766 100644 --- a/src/pkg/runtime/stack.c +++ b/src/pkg/runtime/stack.c @@ -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); |
