OSDN Git Service

1999-11-05 Jeff Sturm <jsturm@sigma6.com>
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Nov 1999 17:34:32 +0000 (17:34 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Nov 1999 17:34:32 +0000 (17:34 +0000)
* boehm.cc (_Jv_GCSetInitialHeapSize): Swapped size & current.
* prims.cc (parse_heap_size): Use end, not spec.  Use 1024
multipler for `k'.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30418 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/boehm.cc
libjava/prims.cc

index f4c8056..fc8b4a6 100644 (file)
@@ -1,3 +1,9 @@
+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'.
+
 1999-11-05  Tom Tromey  <tromey@cygnus.com>
 
        * java/lang/natThread.cc (stop): Removed argument name.
index 33800ed..2ecad74 100644 (file)
@@ -375,7 +375,7 @@ _Jv_GCSetInitialHeapSize (size_t size)
 {
   size_t current = GC_get_heap_size ();
   if (size > current)
-    GC_expand_hp (current - size);
+    GC_expand_hp (size - current);
 }
 
 void
index 6e6c633..6b37d55 100644 (file)
@@ -822,10 +822,10 @@ parse_heap_size (const char *spec)
 {
   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;
 }