aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/mheap.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/mheap.c')
-rw-r--r--libgo/runtime/mheap.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libgo/runtime/mheap.c b/libgo/runtime/mheap.c
index cc6b3af..cacac7d 100644
--- a/libgo/runtime/mheap.c
+++ b/libgo/runtime/mheap.c
@@ -58,10 +58,7 @@ runtime_MHeap_Alloc(MHeap *h, uintptr npage, int32 sizeclass, int32 acct)
MSpan *s;
runtime_lock(h);
- mstats.heap_alloc += m->mcache->local_alloc;
- m->mcache->local_alloc = 0;
- mstats.heap_objects += m->mcache->local_objects;
- m->mcache->local_objects = 0;
+ runtime_purgecachedstats(m);
s = MHeap_AllocLocked(h, npage, sizeclass);
if(s != nil) {
mstats.heap_inuse += npage<<PageShift;
@@ -259,10 +256,7 @@ void
runtime_MHeap_Free(MHeap *h, MSpan *s, int32 acct)
{
runtime_lock(h);
- mstats.heap_alloc += m->mcache->local_alloc;
- m->mcache->local_alloc = 0;
- mstats.heap_objects += m->mcache->local_objects;
- m->mcache->local_objects = 0;
+ runtime_purgecachedstats(m);
mstats.heap_inuse -= s->npages<<PageShift;
if(acct) {
mstats.heap_alloc -= s->npages<<PageShift;