diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/ChunkCache.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/ChunkCache.java index 41e3e469d24..36be4aa0f29 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/ChunkCache.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/ChunkCache.java @@ -100,6 +100,13 @@ public final class ChunkCache { } } + /** + * Returns the maximum size of the chunk cache in bytes. + */ + public synchronized long getMaxSize() { + return (long) fPageTable.length * Database.CHUNK_SIZE; + } + /** * Clears the page table and changes it to hold chunks with * maximum total memory of maxSize. @@ -113,6 +120,7 @@ public final class ChunkCache { System.arraycopy(fPageTable, 0, newTable, 0, oldLength); fTableIsFull= false; fPointer= oldLength; + fPageTable= newTable; } else { for (int i=newLength; i