This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On Mon, Jun 27, 2005 at 01:00:28PM +0100, Andrew Haley wrote: > OK, thanks. The patch is fine with a ChangeLog entry. D'oh! I keep forgetting ChangeLogs. Attached.
Index: ChangeLog
from Robin Green <greenrd@greenrd.org>
PR java/22189
* gnu/gcj/runtime/PersistentByteMap.java (init): Fix rounding error
--- /usr/src/debug/gcc-4.0.0-20050622/libjava/gnu/gcj/runtime/PersistentByteMap.java 2005-02-16 17:32:59.000000000 +0000
+++ gnu/gcj/runtime/PersistentByteMap.java 2005-06-27 12:38:18.000000000 +0100
@@ -175,10 +175,10 @@
// We're going to make that size prime. This isn't
// strictly necessary but it can't hurt.
//
- // We expand the size by 3/2 because the hash table is
- // intolerably slow when more than 2/3 full.
+ // We expand the size by 3/2 and round the result because
+ // the hash table is intolerably slow when more than 2/3 full.
- BigInteger size = new BigInteger(Integer.toString(capacity * 3/2));
+ BigInteger size = new BigInteger(Integer.toString(((capacity*3)+1)/2));
BigInteger two = BigInteger.ONE.add(BigInteger.ONE);
if (size.getLowestSetBit() != 0) // A hard way to say isEven()
Attachment:
pgp00000.pgp
Description: PGP signature
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |