OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 /* | 5 /* |
6 Stack layout parameters. | 6 Stack layout parameters. |
7 Included both by runtime (compiled via 6c) and linkers (compiled via gcc). | 7 Included both by runtime (compiled via 6c) and linkers (compiled via gcc). |
8 | 8 |
9 The per-goroutine g->stackguard is set to point StackGuard bytes | 9 The per-goroutine g->stackguard is set to point StackGuard bytes |
10 above the bottom of the stack. Each function compares its stack | 10 above the bottom of the stack. Each function compares its stack |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // The size of the note handler frame varies among architectures, | 64 // The size of the note handler frame varies among architectures, |
65 // but 512 bytes should be enough for every implementation. | 65 // but 512 bytes should be enough for every implementation. |
66 StackSystem = 512, | 66 StackSystem = 512, |
67 #else | 67 #else |
68 StackSystem = 0, | 68 StackSystem = 0, |
69 #endif // Plan 9 | 69 #endif // Plan 9 |
70 #endif // Windows | 70 #endif // Windows |
71 | 71 |
72 // The amount of extra stack to allocate beyond the size | 72 // The amount of extra stack to allocate beyond the size |
73 // needed for the single frame that triggered the split. | 73 // needed for the single frame that triggered the split. |
74 » StackExtra = 1024, | 74 » StackExtra = 2048, |
75 | 75 |
76 // The minimum stack segment size to allocate. | 76 // The minimum stack segment size to allocate. |
77 // If the amount needed for the splitting frame + StackExtra | 77 // If the amount needed for the splitting frame + StackExtra |
78 // is less than this number, the stack will have this size instead. | 78 // is less than this number, the stack will have this size instead. |
79 » StackMin = 4096, | 79 » StackMin = 8192, |
80 FixedStack = StackMin + StackSystem, | 80 FixedStack = StackMin + StackSystem, |
81 | 81 |
82 // Functions that need frames bigger than this use an extra | 82 // Functions that need frames bigger than this use an extra |
83 // instruction to do the stack split check, to avoid overflow | 83 // instruction to do the stack split check, to avoid overflow |
84 // in case SP - framesize wraps below zero. | 84 // in case SP - framesize wraps below zero. |
85 // This value can be no bigger than the size of the unmapped | 85 // This value can be no bigger than the size of the unmapped |
86 // space at zero. | 86 // space at zero. |
87 StackBig = 4096, | 87 StackBig = 4096, |
88 | 88 |
89 // The stack guard is a pointer this many bytes above the | 89 // The stack guard is a pointer this many bytes above the |
(...skipping 13 matching lines...) Expand all Loading... |
103 // The actual size can be smaller than this but cannot be larger. | 103 // The actual size can be smaller than this but cannot be larger. |
104 // Checked in proc.c's runtime.malg. | 104 // Checked in proc.c's runtime.malg. |
105 StackTop = 96, | 105 StackTop = 96, |
106 }; | 106 }; |
107 | 107 |
108 // Goroutine preemption request. | 108 // Goroutine preemption request. |
109 // Stored into g->stackguard0 to cause split stack check failure. | 109 // Stored into g->stackguard0 to cause split stack check failure. |
110 // Must be greater than any real sp. | 110 // Must be greater than any real sp. |
111 // 0xfffffade in hex. | 111 // 0xfffffade in hex. |
112 #define StackPreempt ((uint64)-1314) | 112 #define StackPreempt ((uint64)-1314) |
OLD | NEW |