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 #include "runtime.h" | 5 #include "runtime.h" |
6 #include "arch.h" | 6 #include "arch.h" |
7 #include "defs.h" | 7 #include "defs.h" |
8 #include "malloc.h" | 8 #include "malloc.h" |
9 #include "os.h" | 9 #include "os.h" |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 runtime·schedinit(void) | 104 runtime·schedinit(void) |
105 { | 105 { |
106 int32 n; | 106 int32 n; |
107 byte *p; | 107 byte *p; |
108 | 108 |
109 runtime·allm = m; | 109 runtime·allm = m; |
110 m->nomemprof++; | 110 m->nomemprof++; |
111 | 111 |
112 runtime·mallocinit(); | 112 runtime·mallocinit(); |
113 runtime·goargs(); | 113 runtime·goargs(); |
| 114 runtime·goenvs(); |
114 | 115 |
115 // For debugging: | 116 // For debugging: |
116 // Allocate internal symbol table representation now, | 117 // Allocate internal symbol table representation now, |
117 // so that we don't need to call malloc when we crash. | 118 // so that we don't need to call malloc when we crash. |
118 // findfunc(0); | 119 // findfunc(0); |
119 | 120 |
120 runtime·sched.gomaxprocs = 1; | 121 runtime·sched.gomaxprocs = 1; |
121 p = runtime·getenv("GOMAXPROCS"); | 122 p = runtime·getenv("GOMAXPROCS"); |
122 if(p != nil && (n = runtime·atoi(p)) != 0) | 123 if(p != nil && (n = runtime·atoi(p)) != 0) |
123 runtime·sched.gomaxprocs = n; | 124 runtime·sched.gomaxprocs = n; |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 ret = m->id; | 1230 ret = m->id; |
1230 FLUSH(&ret); | 1231 FLUSH(&ret); |
1231 } | 1232 } |
1232 | 1233 |
1233 void | 1234 void |
1234 runtime·Goroutines(int32 ret) | 1235 runtime·Goroutines(int32 ret) |
1235 { | 1236 { |
1236 ret = runtime·sched.gcount; | 1237 ret = runtime·sched.gcount; |
1237 FLUSH(&ret); | 1238 FLUSH(&ret); |
1238 } | 1239 } |
OLD | NEW |