mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Ensure the chunk size is a multiple of the alignment, closed https://github.com/OpenHFT/Chronicle-Map/issues/169
This commit is contained in:
Regular → Executable
+2
-2
@@ -708,8 +708,8 @@ public abstract class VanillaChronicleHash<K,
|
||||
|
||||
// int division is MUCH faster than long on Intel CPUs
|
||||
if (sizeInBytes <= Integer.MAX_VALUE)
|
||||
return (((int) sizeInBytes) / (int) chunkSize) + 1;
|
||||
return (int) (sizeInBytes / chunkSize) + 1;
|
||||
return (int) (sizeInBytes + chunkSize - 1) / (int) chunkSize;
|
||||
return Math.toIntExact((sizeInBytes + chunkSize - 1) / chunkSize);
|
||||
}
|
||||
|
||||
public final int size() {
|
||||
|
||||
Reference in New Issue
Block a user