// it might coalesce v and other blocks into a bigger span
// and change the bitmap further.
c->local_nsmallfree[sizeclass]++;
+ c->local_cachealloc -= size;
if(c->alloc[sizeclass] == s) {
// We own the span, so we can just add v to the freelist
runtime·markfreed(v);
p->next = l->list;
l->list = p;
l->nlist++;
- c->local_cachealloc -= size;
// We transfer a span at a time from MCentral to MCache,
// so we'll do the same in the other direction.
runtime·printf("pause %D\n", t4-t0);
if(runtime·debug.gctrace) {
- updatememstats(&stats);
heap1 = mstats.heap_alloc;
+ updatememstats(&stats);
+ if(heap1 != mstats.heap_alloc) {
+ runtime·printf("runtime: mstats skew: heap=%p/%p\n", heap1, mstats.heap_alloc);
+ runtime·throw("mstats skew");
+ }
obj = mstats.nmalloc - mstats.nfree;
stats.nprocyield += work.markfor->nprocyield;