mirror of
https://github.com/corda/corda.git
synced 2024-12-28 16:58:55 +00:00
fix bug in calculating GC footprint in new heap pool code
This commit is contained in:
parent
00c611fcf9
commit
c6e1644281
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user