Returned VanillaContext entry indirection in order to make patterns like map.getUsing(key, byteableValue) working

This commit is contained in:
leventov
2015-01-25 08:55:52 +07:00
parent 6d0b305051
commit 3842755c67
4 changed files with 9 additions and 4 deletions
@@ -134,6 +134,7 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
/////////////////////////////////////////////////
// Bytes Store (essentially, the base address) and serialization-dependent offsets
transient BytesStore ms;
transient Bytes bytes;
transient long headerSize;
transient long segmentHeadersOffset;
@@ -272,6 +273,7 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
final void createMappedStoreAndSegments(BytesStore bytesStore) throws IOException {
this.ms = bytesStore;
bytes = ms.bytes();
onHeaderCreated();
@@ -362,6 +364,8 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
public void close() {
if (ms == null)
return;
bytes.release();
bytes = null;
ms.free();
ms = null;
}