Reviewers: golang-dev1,
Message:
Hello
golan...@googlegroups.com,
I'd like you to review this change to
https://dvyukov%
40goog...@code.google.com/p/go/
Description:
runtime: update comment on stack allocator
Please review this at
https://codereview.appspot.com/9665046/
Affected files:
M src/pkg/runtime/stack.c
Index: src/pkg/runtime/stack.c
===================================================================
--- a/src/pkg/runtime/stack.c
+++ b/src/pkg/runtime/stack.c
@@ -81,13 +81,10 @@
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).
+ // Stack allocator uses fixed-size free-list allocator most of the time.
+ // But if we need a stack of a 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);