From: Russ Cox Date: Tue, 12 Jul 2011 16:26:05 +0000 (-0700) Subject: runtime: fix comment (lost in shuffle) X-Git-Tag: weekly.2011-07-19~105 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=88e0c0517aa0dfdb45441bb361009cd4866afb22;p=gostls13.git runtime: fix comment (lost in shuffle) TBR=dvyukov CC=golang-dev https://golang.org/cl/4710041 --- diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 41a8a1b4df..133203a3ac 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -210,8 +210,11 @@ runtime·idlegoroutine(void) static void mcommoninit(M *m) { + // Add to runtime·allm so garbage collector doesn't free m + // when it is just in a register or thread-local storage. m->alllink = runtime·allm; runtime·allm = m; + m->id = runtime·sched.mcount++; m->fastrand = 0x49f6428aUL + m->id; m->stackalloc = runtime·malloc(sizeof(*m->stackalloc)); @@ -502,8 +505,6 @@ matchmg(void) // Find the m that will run g. if((m = mget(g)) == nil){ m = runtime·malloc(sizeof(M)); - // Add to runtime·allm so garbage collector doesn't free m - // when it is just in a register or thread-local storage. mcommoninit(m); if(runtime·iscgo) {