fix bug in calculating GC footprint in new heap pool code

This commit is contained in:
Joel Dice 2007-08-22 20:24:25 -06:00
parent 00c611fcf9
commit c6e1644281
2 changed files with 7 additions and 2 deletions

View File

@ -114,7 +114,7 @@ killZombies(Thread* t, Thread* o)
unsigned
footprint(Thread* t)
{
unsigned n = t->heapIndex;
unsigned n = t->heapOffset + t->heapIndex;
if (t->large) {
n += extendedSize
@ -366,6 +366,7 @@ postCollect(Thread* t)
#endif
t->heap = t->defaultHeap;
t->heapOffset = 0;
t->heapIndex = 0;
if (t->large) {
@ -1333,6 +1334,7 @@ Thread::Thread(Machine* m, object javaThread, Thread* parent):
sp(0),
frame(-1),
heapIndex(0),
heapOffset(0),
protector(0),
runnable(this)
#ifdef VM_STRESS
@ -1622,6 +1624,8 @@ allocate2(Thread* t, unsigned sizeInBytes)
(t->vm->system->tryAllocate(Thread::HeapSizeInBytes));
if (t->heap) {
t->vm->heapPool[t->vm->heapPoolIndex++] = t->heap;
t->heapOffset += t->heapIndex;
t->heapIndex = 0;
}
}

View File

@ -1098,7 +1098,7 @@ class Machine {
dispose();
}
static const unsigned HeapPoolSize = 16;
static const unsigned HeapPoolSize = 8;
void dispose();
@ -1223,6 +1223,7 @@ class Thread {
unsigned sp;
int frame;
unsigned heapIndex;
unsigned heapOffset;
Protector* protector;
Runnable runnable;
object* heap;