This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: fix -ms, -mx options for gij
- To: java-patches at sourceware dot cygnus dot com
- Subject: Patch: fix -ms, -mx options for gij
- From: Jeff Sturm <jsturm at sigma6 dot com>
- Date: Fri, 05 Nov 1999 11:20:51 -0500
- Organization: AppNet
The options to set initial, maximum heap did not work as advertised.
I've tested the patch below. It is _not_ committed.
Jeff
1999-11-05 Jeff Sturm <jsturm@sigma6.com>
* boehm.cc (_Jv_GCSetInitialHeapSize): Swapped size & current.
* prims.cc (parse_heap_size): Use end, not spec. Use 1024
multipler for `k'.
Index: boehm.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/boehm.cc,v
retrieving revision 1.10
diff -u -r1.10 boehm.cc
--- boehm.cc 1999/11/03 01:15:40 1.10
+++ boehm.cc 1999/11/05 17:11:01
@@ -375,7 +375,7 @@
{
size_t current = GC_get_heap_size ();
if (size > current)
- GC_expand_hp (current - size);
+ GC_expand_hp (size - current);
}
void
Index: prims.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/prims.cc,v
retrieving revision 1.12
diff -u -r1.12 prims.cc
--- prims.cc 1999/10/22 19:43:39 1.12
+++ prims.cc 1999/11/05 17:11:02
@@ -822,10 +822,10 @@
{
char *end;
unsigned long val = strtoul (spec, &end, 10);
- if (*spec == 'k' || *spec == 'K')
- val *= 1000;
- else if (*spec == 'm' || *spec == 'M')
- val *= 1000000;
+ if (*end == 'k' || *end == 'K')
+ val *= 1024;
+ else if (*end == 'm' || *end == 'M')
+ val *= 1048576;
return (size_t) val;
}