mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
fixed https://github.com/OpenHFT/Chronicle-Map/issues/166 void relocation(Data<V> newValue, long newEntrySize) to void relocation(newValue, newSizeOfEverythingBeforeValue);`
This commit is contained in:
@@ -145,7 +145,7 @@ public abstract class MapEntryStages<K, V> extends HashEntryStages<K>
|
||||
if (s.realloc(pos, entrySizeInChunks, newSizeInChunks)) {
|
||||
break newValueDoesNotFit;
|
||||
}
|
||||
relocation(newValue, newSizeOfEverythingBeforeValue);
|
||||
relocation(newValue, newEntrySize);
|
||||
return;
|
||||
} else if (newSizeInChunks < entrySizeInChunks) {
|
||||
s.freeExtra(pos + 1, entrySizeInChunks, newSizeInChunks);
|
||||
@@ -186,15 +186,14 @@ public abstract class MapEntryStages<K, V> extends HashEntryStages<K>
|
||||
newValueOffset + newValue.size() - entryStartOffset;
|
||||
}
|
||||
|
||||
protected void relocation(Data<V> newValue, long newSizeOfEverythingBeforeValue) {
|
||||
long entrySize = innerEntrySize(newSizeOfEverythingBeforeValue, newValue.size());
|
||||
protected void relocation(Data<V> newValue, long newEntrySize) {
|
||||
// need to copy, because in initEntryAndKeyCopying(), in alloc(), nextTier() called ->
|
||||
// hashLookupPos cleared, as a dependant
|
||||
long oldHashLookupPos = hlp.hashLookupPos;
|
||||
long oldHashLookupAddr = s.tierBaseAddr;
|
||||
|
||||
boolean tierHasChanged = allocatedChunks.initEntryAndKeyCopying(
|
||||
entrySize, valueSizeOffset - keySizeOffset, pos, entrySizeInChunks);
|
||||
newEntrySize, valueSizeOffset - keySizeOffset, pos, entrySizeInChunks);
|
||||
|
||||
if (tierHasChanged) {
|
||||
// implicitly inits key search, locating hashLookupPos on the empty slot
|
||||
|
||||
+2
-2
@@ -167,10 +167,10 @@ public abstract class ReplicatedMapEntryStages<K, V> extends MapEntryStages<K, V
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void relocation(Data<V> newValue, long newSizeOfEverythingBeforeValue) {
|
||||
protected void relocation(Data<V> newValue, long newEntrySize) {
|
||||
long oldPos = pos;
|
||||
long oldTierIndex = s.tierIndex;
|
||||
super.relocation(newValue, newSizeOfEverythingBeforeValue);
|
||||
super.relocation(newValue, newEntrySize);
|
||||
ru.moveChange(oldTierIndex, oldPos, pos);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user