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);
b->recent_alloc_bytes += size;
setaddrbucket((uintptr)p, b);
runtime·unlock(&proflock);
- m->nomemprof--;
}
// Called when freeing a profiled block.
{
Bucket *b;
- if(m->nomemprof > 0)
- return;
-
- m->nomemprof++;
runtime·lock(&proflock);
b = getaddrbucket((uintptr)p);
if(b != nil) {
b->recent_free_bytes += size;
}
runtime·unlock(&proflock);
- m->nomemprof--;
}
int64 runtime·blockprofilerate; // in CPU ticks
runtime·sched.maxmcount = 10000;
runtime·precisestack = haveexperiment("precisestack");
- m->nomemprof++;
runtime·mprofinit();
runtime·mallocinit();
mcommoninit(m);
procresize(procs);
mstats.enablegc = 1;
- m->nomemprof--;
if(raceenabled)
g->racectx = runtime·raceinit();