mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
C: fix GC
This commit is contained in:
parent
3ed75a97d4
commit
8a359c6434
|
@ -312,16 +312,16 @@ public final class GC {
|
||||||
if (!object.toAddress().isLessThan(currentRegionEnd)) {
|
if (!object.toAddress().isLessThan(currentRegionEnd)) {
|
||||||
currentRegionIndex = (int) ((object.toAddress().toLong() - heapAddress().toLong()) / regionSize());
|
currentRegionIndex = (int) ((object.toAddress().toLong() - heapAddress().toLong()) / regionSize());
|
||||||
Region currentRegion = Structure.add(Region.class, regionsAddress(), currentRegionIndex);
|
Region currentRegion = Structure.add(Region.class, regionsAddress(), currentRegionIndex);
|
||||||
if (currentRegion.start == 0) {
|
while (currentRegion.start == 0) {
|
||||||
do {
|
|
||||||
if (++currentRegionIndex == regionsCount) {
|
if (++currentRegionIndex == regionsCount) {
|
||||||
object = limit.toStructure();
|
object = limit.toStructure();
|
||||||
break loop;
|
break loop;
|
||||||
}
|
}
|
||||||
currentRegion = Structure.add(Region.class, regionsAddress(), currentRegionIndex);
|
currentRegion = Structure.add(Region.class, regionsAddress(), currentRegionIndex);
|
||||||
} while (currentRegion.start == 0);
|
|
||||||
}
|
}
|
||||||
currentRegionEnd = currentRegion.toAddress().add(regionSize());
|
Address newRegionStart = heapAddress().add(currentRegionIndex * regionSize());
|
||||||
|
object = newRegionStart.add(currentRegion.start - 1).toStructure();
|
||||||
|
currentRegionEnd = newRegionStart.add(regionSize());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (lastFreeSpace != null) {
|
if (lastFreeSpace != null) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user