mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Added ARM support for UnsafeMemory, https://github.com/OpenHFT/OpenHFT/issues/23
This commit is contained in:
@@ -750,6 +750,7 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
double valueSize = averageValueSize();
|
||||
size += averageSizeStoringLength(valueBuilder, valueSize);
|
||||
int alignment = valueAlignment();
|
||||
size = alignAddr((long) Math.ceil(size), alignment); // so the value starts aligned
|
||||
int worstAlignment;
|
||||
if (worstAlignmentComputationRequiresValueSize(alignment)) {
|
||||
long constantSizeBeforeAlignment = toLong(size);
|
||||
@@ -925,6 +926,8 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
throw new IllegalArgumentException("Alignment should be a power of 2, " + alignment +
|
||||
" given");
|
||||
}
|
||||
if (Jvm.isArm() && alignment < 8)
|
||||
return this;
|
||||
this.alignment = alignment;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,6 @@ public enum ZeroBytesStore implements BytesStore<ZeroBytesStore, Void> {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean compareAndSwapLong(long offset, long expected, long value) {
|
||||
if (expected != 0 || value != 0)
|
||||
@@ -152,6 +151,7 @@ public enum ZeroBytesStore implements BytesStore<ZeroBytesStore, Void> {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void reserve() throws IllegalStateException {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user