diff options
Diffstat (limited to 'src/pkg/runtime/malloc.cgo')
| -rw-r--r-- | src/pkg/runtime/malloc.cgo | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.cgo b/src/pkg/runtime/malloc.cgo index fed8e037c..2e7818a39 100644 --- a/src/pkg/runtime/malloc.cgo +++ b/src/pkg/runtime/malloc.cgo @@ -234,7 +234,12 @@ mlookup(void *v, byte **base, uintptr *size, MSpan **sp, uint32 **ref) MCache* allocmcache(void) { - return FixAlloc_Alloc(&mheap.cachealloc); + MCache *c; + + c = FixAlloc_Alloc(&mheap.cachealloc); + mstats.mcache_inuse = mheap.cachealloc.inuse; + mstats.mcache_sys = mheap.cachealloc.sys; + return c; } void @@ -289,6 +294,8 @@ stackalloc(uint32 n) throw("stackalloc"); } v = FixAlloc_Alloc(&stacks); + mstats.stacks_inuse = stacks.inuse; + mstats.stacks_sys = stacks.sys; unlock(&stacks); return v; } @@ -305,6 +312,8 @@ stackfree(void *v) if(m->mallocing || m->gcing) { lock(&stacks); FixAlloc_Free(&stacks, v); + mstats.stacks_inuse = stacks.inuse; + mstats.stacks_sys = stacks.sys; unlock(&stacks); return; } |
