Fixed possible int overflow when storing segmentHeaderOffset, closes https://github.com/ChronicleEnterprise/Chronicle-Map-Enterprise/issues/46

This commit is contained in:
Ivan Rakov
2021-02-25 17:25:31 +03:00
parent 596056c33a
commit 4b2050d07e
4 changed files with 349 additions and 1 deletions
@@ -0,0 +1,20 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.values.Group;
import net.openhft.chronicle.values.Range;
import net.openhft.chronicle.values.Values;
/**
* Extends segment headers offset from int to long - it may be greater than 4GB for large data stores.
*/
public interface ReplicatedGlobalMutableStateV2 extends ReplicatedGlobalMutableState {
static void main(String[] args) {
System.setProperty("chronicle.values.dumpCode", "true");
Values.nativeClassFor(ReplicatedGlobalMutableStateV2.class);
}
@Group(9)
long getSegmentHeadersOffset();
void setSegmentHeadersOffset(@Range(min = 0/*, max = 9223372036854775807L*/) long segmentHeadersOffset);
}