diff options
Diffstat (limited to 'src/pkg/runtime/malloc.goc')
| -rw-r--r-- | src/pkg/runtime/malloc.goc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.goc b/src/pkg/runtime/malloc.goc index c3ede4abdd..46d6450c06 100644 --- a/src/pkg/runtime/malloc.goc +++ b/src/pkg/runtime/malloc.goc @@ -122,6 +122,9 @@ runtime·mallocgc(uintptr size, uintptr typ, uint32 flag) if(m->locks == 0 && g->preempt) // restore the preemption request in case we've cleared it in newstack g->stackguard0 = StackPreempt; + if(runtime·debug.allocfreetrace) + goto profile; + if(!(flag & FlagNoProfiling) && (rate = runtime·MemProfileRate) > 0) { if(size >= rate) goto profile; @@ -135,7 +138,7 @@ runtime·mallocgc(uintptr size, uintptr typ, uint32 flag) m->mcache->next_sample = runtime·fastrand1() % (2*rate); profile: runtime·setblockspecial(v, true); - runtime·MProf_Malloc(v, size); + runtime·MProf_Malloc(v, size, typ); } } |
