so that the garbage collector doesn't free them.
R=ken
OCL=35538
CL=35538
G g0; // idle goroutine for m0
static int32 debug = 0;
-static Lock debuglock;
// Go scheduler
//
{
int32 n;
byte *p;
+
+ allm = m;
mallocinit();
goargs();
// Find the m that will run g.
if((m = mget(g)) == nil){
m = malloc(sizeof(M));
+ // Add to allm so garbage collector doesn't free m
+ // when it is just in a register (R14 on amd64).
+ m->alllink = allm;
+ allm = m;
m->g0 = malg(8192);
m->id = sched.mcount++;
int32 waitnextg;
Note havenextg;
G* nextg;
+ M* alllink; // on allm
M* schedlink;
Mem mem;
uint32 machport; // Return address for Mach IPC (OS X)
extern Alg algarray[Amax];
extern String emptystring;
G* allg;
+M* allm;
int32 goidgen;
extern int32 gomaxprocs;
extern int32 panicking;