Commit f6329700 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: remove nomemprof

Nomemprof seems to be unneeded now, there is no recursion.
If the recursion will be re-introduced, it will break loudly by deadlocking.
Fixes #6566.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/14695044
parent f5d25fd6
......@@ -255,10 +255,6 @@ runtime·MProf_Malloc(void *p, uintptr size)
uintptr stk[32];
Bucket *b;
if(m->nomemprof > 0)
return;
m->nomemprof++;
nstk = runtime·callers(1, stk, 32);
runtime·lock(&proflock);
b = stkbucket(MProf, stk, nstk, true);
......@@ -266,7 +262,6 @@ runtime·MProf_Malloc(void *p, uintptr size)
b->recent_alloc_bytes += size;
setaddrbucket((uintptr)p, b);
runtime·unlock(&proflock);
m->nomemprof--;
}
// Called when freeing a profiled block.
......@@ -275,10 +270,6 @@ runtime·MProf_Free(void *p, uintptr size)
{
Bucket *b;
if(m->nomemprof > 0)
return;
m->nomemprof++;
runtime·lock(&proflock);
b = getaddrbucket((uintptr)p);
if(b != nil) {
......@@ -286,7 +277,6 @@ runtime·MProf_Free(void *p, uintptr size)
b->recent_free_bytes += size;
}
runtime·unlock(&proflock);
m->nomemprof--;
}
int64 runtime·blockprofilerate; // in CPU ticks
......
......@@ -133,7 +133,6 @@ runtime·schedinit(void)
runtime·sched.maxmcount = 10000;
runtime·precisestack = haveexperiment("precisestack");
m->nomemprof++;
runtime·mprofinit();
runtime·mallocinit();
mcommoninit(m);
......@@ -163,7 +162,6 @@ runtime·schedinit(void)
procresize(procs);
mstats.enablegc = 1;
m->nomemprof--;
if(raceenabled)
g->racectx = runtime·raceinit();
......
......@@ -310,7 +310,6 @@ struct M
int32 throwing;
int32 gcing;
int32 locks;
int32 nomemprof;
int32 dying;
int32 profilehz;
int32 helpgc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment