From b320422e7558cf1d72326284406b9adca65dfa2b Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Tue, 27 Feb 2007 13:44:03 +0000 Subject: [PATCH] add getRecord, make clear() public, some housekeeping --- .../eclipse/cdt/internal/core/pdom/db/DBProperties.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java index d392361a11c..27a23cf881e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java @@ -33,7 +33,7 @@ public class DBProperties { * @throws CoreException */ public DBProperties(Database db) throws CoreException { - this.record= db.malloc(4); + this.record= db.malloc(RECORD_SIZE); this.index= new BTree(db, record + PROP_INDEX, DBProperty.getComparator(db)); this.db= db; } @@ -125,7 +125,7 @@ public class DBProperties { * it can be repopulated. * @throws CoreException */ - private void clear() throws CoreException { + public void clear() throws CoreException { index.accept(new IBTreeVisitor(){ public int compare(int record) throws CoreException { return 0; @@ -148,6 +148,10 @@ public class DBProperties { db.free(record); } + public int getRecord() { + return record; + } + private static class DBProperty { static final int KEY = 0; static final int VALUE = 4;