diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-09-13 13:13:44 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-09-13 13:13:44 +0200 |
| commit | 9464a0c36318f8a801c07d6874bd0cea40f12504 (patch) | |
| tree | f0178491c19d4f1ebc7b92eede86690998466480 /src/pkg/runtime/mheap.c | |
| parent | ba9fda6068cfadd42db0b152fdca7e8b67aaf77d (diff) | |
| parent | 5ff4c17907d5b19510a62e08fd8d3b11e62b431d (diff) | |
| download | golang-9464a0c36318f8a801c07d6874bd0cea40f12504.tar.gz | |
Merge commit 'upstream/60' into debian-sid
Diffstat (limited to 'src/pkg/runtime/mheap.c')
| -rw-r--r-- | src/pkg/runtime/mheap.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/pkg/runtime/mheap.c b/src/pkg/runtime/mheap.c index dde31ce34..37d505681 100644 --- a/src/pkg/runtime/mheap.c +++ b/src/pkg/runtime/mheap.c @@ -57,10 +57,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; @@ -258,10 +255,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; |
