mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Fixed a bug in doReplaceValue()
This commit is contained in:
@@ -41,7 +41,10 @@ public class AllocatedChunks {
|
||||
|
||||
public void initEntryAndKeyCopying(long entrySize, long bytesToCopy) {
|
||||
initAllocatedChunks(hh.h().inChunks(entrySize));
|
||||
entry.copyExistingEntry(s.alloc(allocatedChunks), bytesToCopy);
|
||||
// call incrementSegmentEntriesIfNeeded() before entry.copyExistingEntry(), because
|
||||
// the latter clears out searchState, and it performs the search again, but in inconsistent
|
||||
// state
|
||||
incrementSegmentEntriesIfNeeded();
|
||||
entry.copyExistingEntry(s.alloc(allocatedChunks), bytesToCopy);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -39,7 +39,9 @@ public class SearchAllocatedChunks extends AllocatedChunks {
|
||||
|
||||
public void initEntryAndKey(long entrySize) {
|
||||
initAllocatedChunks(hh.h().inChunks(entrySize));
|
||||
entry.writeNewEntry(s.alloc(allocatedChunks), q.inputKey);
|
||||
// call incrementSegmentEntriesIfNeeded() before entry.writeNewEntry(), because the latter
|
||||
// clears out searchState, and it performs the search again, but in inconsistent state
|
||||
incrementSegmentEntriesIfNeeded();
|
||||
entry.writeNewEntry(s.alloc(allocatedChunks), q.inputKey);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ public abstract class MapEntryStages<K, V> extends HashEntryStages<K>
|
||||
@Stage("ValSize") public long valueSize = -1;
|
||||
@Stage("ValSize") public long valueOffset;
|
||||
|
||||
@Stage("ValSize") private void countValueOffset() {
|
||||
@Stage("ValSize")
|
||||
private void countValueOffset() {
|
||||
mh.m().alignment.alignPositionAddr(entryBytes);
|
||||
valueOffset = entryBytes.position();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user