OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 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 * basic types | 6 * basic types |
7 */ | 7 */ |
8 typedef signed char int8; | 8 typedef signed char int8; |
9 typedef unsigned char uint8; | 9 typedef unsigned char uint8; |
10 typedef signed short int16; | 10 typedef signed short int16; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 }; | 121 }; |
122 enum | 122 enum |
123 { | 123 { |
124 true = 1, | 124 true = 1, |
125 false = 0, | 125 false = 0, |
126 }; | 126 }; |
127 enum | 127 enum |
128 { | 128 { |
129 PtrSize = sizeof(void*), | 129 PtrSize = sizeof(void*), |
130 }; | 130 }; |
| 131 enum |
| 132 { |
| 133 // Per-M stack segment cache size. |
| 134 StackCacheSize = 32, |
| 135 // Global <-> per-M stack segment cache transfer batch size. |
| 136 StackCacheBatch = 16, |
| 137 }; |
131 | 138 |
132 /* | 139 /* |
133 * structures | 140 * structures |
134 */ | 141 */ |
135 union Lock | 142 union Lock |
136 { | 143 { |
137 uint32 key; // futex-based impl | 144 uint32 key; // futex-based impl |
138 M* waitm; // linked list of waiting M's (sema-based impl) | 145 M* waitm; // linked list of waiting M's (sema-based impl) |
139 }; | 146 }; |
140 union Note | 147 union Note |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 uint32 fastrand; | 262 uint32 fastrand; |
256 uint64 ncgocall; // number of cgo calls in total | 263 uint64 ncgocall; // number of cgo calls in total |
257 int32 ncgo; // number of cgo calls currently in progress | 264 int32 ncgo; // number of cgo calls currently in progress |
258 CgoMal* cgomal; | 265 CgoMal* cgomal; |
259 Note havenextg; | 266 Note havenextg; |
260 G* nextg; | 267 G* nextg; |
261 M* alllink; // on allm | 268 M* alllink; // on allm |
262 M* schedlink; | 269 M* schedlink; |
263 uint32 machport; // Return address for Mach IPC (OS X) | 270 uint32 machport; // Return address for Mach IPC (OS X) |
264 MCache *mcache; | 271 MCache *mcache; |
265 » FixAlloc» *stackalloc; | 272 » int32» stackinuse; |
| 273 » uint32» stackcachepos; |
| 274 » uint32» stackcachecnt; |
| 275 » void*» stackcache[StackCacheSize]; |
266 G* lockedg; | 276 G* lockedg; |
267 G* idleg; | 277 G* idleg; |
268 uintptr createstack[32]; // Stack that created this thread. | 278 uintptr createstack[32]; // Stack that created this thread. |
269 uint32 freglo[16]; // D[i] lsb and F[i] | 279 uint32 freglo[16]; // D[i] lsb and F[i] |
270 uint32 freghi[16]; // D[i] msb and F[i+16] | 280 uint32 freghi[16]; // D[i] msb and F[i+16] |
271 uint32 fflag; // floating point compare flags | 281 uint32 fflag; // floating point compare flags |
272 M* nextwaitm; // next M waiting for lock | 282 M* nextwaitm; // next M waiting for lock |
273 uintptr waitsema; // semaphore for parking on locks | 283 uintptr waitsema; // semaphore for parking on locks |
274 uint32 waitsemacount; | 284 uint32 waitsemacount; |
275 uint32 waitsemalock; | 285 uint32 waitsemalock; |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 extern float64 runtime·neginf; | 887 extern float64 runtime·neginf; |
878 extern uint64 ·nan; | 888 extern uint64 ·nan; |
879 extern uint64 ·posinf; | 889 extern uint64 ·posinf; |
880 extern uint64 ·neginf; | 890 extern uint64 ·neginf; |
881 #define ISNAN(f) ((f) != (f)) | 891 #define ISNAN(f) ((f) != (f)) |
882 | 892 |
883 enum | 893 enum |
884 { | 894 { |
885 UseSpanType = 1, | 895 UseSpanType = 1, |
886 }; | 896 }; |
OLD | NEW |