From 8342d3bdbe2e14ad44dfc708e00daf721dae6a58 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 2 Aug 2015 01:13:48 +0200 Subject: IntBitfield: Fix units calculation ( +7 -> +31 for ceiling, using 32bits per unit) --- src/java/com/jogamp/common/util/IntBitfield.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/java/com/jogamp/common') diff --git a/src/java/com/jogamp/common/util/IntBitfield.java b/src/java/com/jogamp/common/util/IntBitfield.java index e7a9d70..6aad391 100644 --- a/src/java/com/jogamp/common/util/IntBitfield.java +++ b/src/java/com/jogamp/common/util/IntBitfield.java @@ -54,7 +54,7 @@ public class IntBitfield { * @param bitCount */ public IntBitfield(final long bitCount) { - final int units = (int) Math.max(1L, ( bitCount + 7L ) >>> UNIT_SHIFT_L); + final int units = (int) Math.max(1L, ( bitCount + 31L ) >>> UNIT_SHIFT_L); this.storage = new int[units]; this.bitsCountL = (long)units << UNIT_SHIFT_L ; this.bitsCountI = bitsCountL > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)bitsCountL; @@ -64,7 +64,7 @@ public class IntBitfield { * @param bitCount */ public IntBitfield(final int bitCount) { - final int units = Math.max(1, ( bitCount + 7 ) >>> UNIT_SHIFT_I); + final int units = Math.max(1, ( bitCount + 31 ) >>> UNIT_SHIFT_I); this.storage = new int[units]; this.bitsCountI = units << UNIT_SHIFT_I; this.bitsCountL = bitsCountI; -- cgit v1.2.3