diff --git a/src/machine.cpp b/src/machine.cpp index 6ae39f7b30..24fd6c0a8e 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -273,6 +273,8 @@ killZombies(Thread* t, Thread* o) unsigned footprint(Thread* t) { + expect(t, t->criticalLevel == 0); + unsigned n = t->heapOffset + t->heapIndex + t->backupHeapIndex; for (Thread* c = t->child; c; c = c->peer) { @@ -592,6 +594,8 @@ postVisit(Thread* t, Heap::Visitor* v) m->tenuredWeakReferences = firstNewTenuredWeakReference; } + m->heap->postVisit(); + for (Reference* r = m->jniReferences; r; r = r->next) { if (r->weak) { if (m->heap->status(r->target) == Heap::Unreachable) { @@ -2693,8 +2697,6 @@ class HeapClient: public Heap::Client { virtual void visitRoots(Heap::Visitor* v) { ::visitRoots(m, v); - m->heap->postVisit(); - postVisit(m->rootThread, v); }