]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix stacks_sys accounting
authorKeith Randall <khr@golang.org>
Sat, 19 Jul 2014 17:29:57 +0000 (10:29 -0700)
committerKeith Randall <khr@golang.org>
Sat, 19 Jul 2014 17:29:57 +0000 (10:29 -0700)
subtract freed count before span gets merged during free.

LGTM=dvyukov
R=dmitry, dvyukov
CC=golang-codereviews
https://golang.org/cl/112450045

src/pkg/runtime/mheap.c

index c03287fd4b92dedc999f0aeeba9a200383b6b207..202a903ff82b2e1634b524731dba8ca4ffa43a76 100644 (file)
@@ -507,8 +507,8 @@ runtime·MHeap_FreeStack(MHeap *h, MSpan *s)
                runtime·throw("mheap_freestack not on M stack");
        s->needzero = 1;
        runtime·lock(h);
-       MHeap_FreeSpanLocked(h, s);
        mstats.stacks_inuse -= s->npages<<PageShift;
+       MHeap_FreeSpanLocked(h, s);
        runtime·unlock(h);
 }