more debug
This commit is contained in:
@@ -107,12 +107,14 @@ public class BasicAsyncGeometryManager implements IGeometryManager {
|
|||||||
private SectionMeta createMeta(BuiltSection section) {
|
private SectionMeta createMeta(BuiltSection section) {
|
||||||
if ((section.geometryBuffer.size%GEOMETRY_ELEMENT_SIZE)!=0) throw new IllegalStateException();
|
if ((section.geometryBuffer.size%GEOMETRY_ELEMENT_SIZE)!=0) throw new IllegalStateException();
|
||||||
int size = (int) (section.geometryBuffer.size/GEOMETRY_ELEMENT_SIZE);
|
int size = (int) (section.geometryBuffer.size/GEOMETRY_ELEMENT_SIZE);
|
||||||
|
//clamp size upwards
|
||||||
|
int upsized = (size+511)&~511;
|
||||||
//Address
|
//Address
|
||||||
int addr = (int)this.allocationHeap.alloc(size);
|
int addr = (int)this.allocationHeap.alloc(upsized);
|
||||||
if (addr == -1) {
|
if (addr == -1) {
|
||||||
throw new IllegalStateException("Geometry OOM");
|
throw new IllegalStateException("Geometry OOM. requested allocation size (in elements): " + size + ", Heap size at top remaining: " + (this.allocationHeap.getLimit()-this.allocationHeap.getSize()) + ", used elements: " + this.usedCapacity);
|
||||||
}
|
}
|
||||||
this.usedCapacity += size;
|
this.usedCapacity += upsized;
|
||||||
//Create upload
|
//Create upload
|
||||||
if (this.heapUploads.put(addr, section.geometryBuffer) != null) {
|
if (this.heapUploads.put(addr, section.geometryBuffer) != null) {
|
||||||
throw new IllegalStateException("Addr: " + addr);
|
throw new IllegalStateException("Addr: " + addr);
|
||||||
|
|||||||
@@ -190,4 +190,8 @@ public class AllocationArena {
|
|||||||
throw new IllegalStateException("Size set smaller than current size");
|
throw new IllegalStateException("Size set smaller than current size");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getLimit() {
|
||||||
|
return this.sizeLimit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user