introduced NativeBytesI to allow us to checks if the buffer has been closed, if the buffer is accessed after it is closed an exception is thrown, This class should be used to investigate JVM crashes, it should not be used in production code ( as its slow )

This commit is contained in:
Rob Austin
2015-02-01 22:19:41 +00:00
parent 938b9dca7b
commit bec5b2a3c5
3 changed files with 27 additions and 25 deletions
@@ -21,7 +21,7 @@ package net.openhft.chronicle.map;
import net.openhft.lang.Maths;
import net.openhft.lang.collection.ATSDirectBitSet;
import net.openhft.lang.io.DirectStore;
import net.openhft.lang.io.NativeBytes;
import net.openhft.lang.io.NativeBytesI;
import static net.openhft.lang.Maths.isPowerOf2;
import static net.openhft.lang.MemoryUnit.*;
@@ -39,7 +39,7 @@ enum MultiMapFactory {
}
@Override
public MultiMap create(NativeBytes bytes, NativeBytes bitSetBytes) {
public MultiMap create(NativeBytesI bytes, NativeBytesI bitSetBytes) {
return new ShortShortMultiMap(bytes, bitSetBytes);
}
},
@@ -50,7 +50,7 @@ enum MultiMapFactory {
}
@Override
public MultiMap create(NativeBytes bytes, NativeBytes bitSetBytes) {
public MultiMap create(NativeBytesI bytes, NativeBytesI bitSetBytes) {
return new Int24Int24MultiMap(bytes, bitSetBytes);
}
},
@@ -61,7 +61,7 @@ enum MultiMapFactory {
}
@Override
public MultiMap create(NativeBytes bytes, NativeBytes bitSetBytes) {
public MultiMap create(NativeBytesI bytes, NativeBytesI bitSetBytes) {
return new IntIntMultiMap(bytes, bitSetBytes);
}
};
@@ -104,5 +104,5 @@ enum MultiMapFactory {
public abstract long sizeInBytes(long minCapacity);
public abstract MultiMap create(NativeBytes bytes, NativeBytes bitSetBytes);
public abstract MultiMap create(NativeBytesI bytes, NativeBytesI bitSetBytes);
}