mirror of
https://github.com/corda/corda.git
synced 2025-01-19 11:16:54 +00:00
never trigger a GC due to an immortal allocation
This commit is contained in:
parent
fb9b2bf173
commit
207f093464
@ -2053,11 +2053,9 @@ allocate3(Thread* t, Allocator* allocator, Machine::AllocationType type,
|
||||
ENTER(t, Thread::IdleState);
|
||||
}
|
||||
|
||||
if (type == Machine::FixedAllocation) {
|
||||
if (t->m->fixedFootprint + sizeInBytes > FixedFootprintThresholdInBytes) {
|
||||
t->heap = 0;
|
||||
}
|
||||
} else if (t->heapIndex + ceiling(sizeInBytes, BytesPerWord)
|
||||
switch (type) {
|
||||
case Machine::MovableAllocation:
|
||||
if (t->heapIndex + ceiling(sizeInBytes, BytesPerWord)
|
||||
> ThreadHeapSizeInWords)
|
||||
{
|
||||
t->heap = 0;
|
||||
@ -2071,6 +2069,17 @@ allocate3(Thread* t, Allocator* allocator, Machine::AllocationType type,
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Machine::FixedAllocation:
|
||||
if (t->m->fixedFootprint + sizeInBytes > FixedFootprintThresholdInBytes) {
|
||||
t->heap = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case Machine::ImmortalAllocation:
|
||||
break;
|
||||
}
|
||||
|
||||
if (t->heap == 0) {
|
||||
// fprintf(stderr, "gc");
|
||||
|
Loading…
Reference in New Issue
Block a user