Clearly separated notion of entries and chunks, averageKeySize()/ValueSize() instead of keySize()/valueSize(), minor fixes and refactorings

This commit is contained in:
leventov
2014-12-26 05:22:54 +07:00
parent 06fcaa4c71
commit 81f6142af7
44 changed files with 923 additions and 587 deletions
@@ -44,6 +44,11 @@ public enum Alignment {
int alignSize(int size) {
return size;
}
@Override
int alignment() {
return 0;
}
},
/**
@@ -64,6 +69,11 @@ public enum Alignment {
int alignSize(int size) {
return (size + 3) & ~3;
}
@Override
int alignment() {
return 4;
}
},
/**
@@ -84,6 +94,11 @@ public enum Alignment {
int alignSize(int size) {
return (size + 7) & ~7;
}
@Override
int alignment() {
return 8;
}
};
private static final Alignment[] VALUES = values();
@@ -97,4 +112,6 @@ public enum Alignment {
abstract long alignAddr(long addr);
abstract int alignSize(int size);
abstract int alignment();
}