From 1384a56768788bf58196c4cc310b721ce2c9769b Mon Sep 17 00:00:00 2001 From: leventov Date: Mon, 5 Oct 2015 10:12:39 +0300 Subject: [PATCH] Align tier bulks to mapping granularity, instead of page boundary --- .../chronicle/hash/impl/VanillaChronicleHash.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java b/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java index 104842592..9d4e11480 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java @@ -20,6 +20,7 @@ import net.openhft.chronicle.algo.bytes.Access; import net.openhft.chronicle.algo.locks.*; import net.openhft.chronicle.bytes.NativeBytesStore; import net.openhft.chronicle.core.Maths; +import net.openhft.chronicle.core.OS; import net.openhft.chronicle.hash.*; import net.openhft.chronicle.hash.impl.util.BuildVersion; import net.openhft.chronicle.hash.serialization.BytesReader; @@ -256,15 +257,14 @@ public abstract class VanillaChronicleHash(); - long tierBulkOffset = roundUpRuntimePageSize(sizeInBytesWithoutTiers()); + long tierBulkOffset = OS.mapAlign(sizeInBytesWithoutTiers()); if (byteStoreSize >= tierBulkOffset + tierBulkSizeInBytes) { assert !createdOrInMemory : "Chronicle Map is allocated in-memory or created " + "persisted without extra tier bulks"; @@ -418,8 +418,7 @@ public abstract class VanillaChronicleHash