* src/vm/options.c (opt_heapmaxsize, opt_heapstartsize): Added.
authortwisti <none@none>
Tue, 23 May 2006 08:42:46 +0000 (08:42 +0000)
committertwisti <none@none>
Tue, 23 May 2006 08:42:46 +0000 (08:42 +0000)
* src/vm/options.h: Likewise.

* src/vm/vm.c (version): Print heap and stack information.
(vm_create): Use global option variables.

src/vm/options.c
src/vm/options.h
src/vm/vm.c

index c0bc33dcbd4d0feb1d8a0f5c78f78d0793926418..32facd9c869d23907781103f98b7c60ac15820eb 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: options.c 4834 2006-04-25 12:25:43Z edwin $
+   $Id: options.c 4942 2006-05-23 08:42:46Z twisti $
 
 */
 
@@ -61,7 +61,9 @@ bool opt_intrp = true;          /* interpreter mode execution (default)       */
 
 bool opt_run = true;
 
-s4   opt_stacksize = 0;         /* thread stack size                          */
+s4   opt_heapmaxsize   = 0;     /* maximum heap size                          */
+s4   opt_heapstartsize = 0;     /* initial heap size                          */
+s4   opt_stacksize     = 0;     /* thread stack size                          */
 
 bool opt_verbose = false;
 bool compileall = false;
index b9504d344376e57953d4a845919f64aa845dfeec..373c613acfcc4c8fb2bc3701cd032fdfca9affa7 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: options.h 4834 2006-04-25 12:25:43Z edwin $
+   $Id: options.h 4942 2006-05-23 08:42:46Z twisti $
 
 */
 
@@ -73,7 +73,10 @@ extern bool opt_intrp;
 extern bool opt_jar;
 extern bool opt_run;
 
+extern s4   opt_heapmaxsize;
+extern s4   opt_heapstartsize;
 extern s4   opt_stacksize;
+
 extern bool opt_verbose;
 extern bool compileall;
 
index b584720f1afe4f1e4a5fd3decba7759a9541c312..55f48b1b918ad4f743d73d05376cc1b167dc067d 100644 (file)
@@ -470,12 +470,18 @@ static void version(void)
 #endif
        puts("  CFLAGS     : "VERSION_CFLAGS"\n");
 
-       puts("Default classpath variables:\n");
-       puts("  java.boot.class.path    : "CACAO_VM_ZIP_PATH":"CLASSPATH_GLIBJ_ZIP_PATH"");
-       puts("  java.library.path       : "CLASSPATH_LIBRARY_PATH"\n");
-
-       puts("Runtime classpath variables:\n");
-       printf("  java.boot.class.path    : %s\n", bootclasspath);
+       puts("Default variables:\n");
+       printf("  maximum heap size   : %d\n", HEAP_MAXSIZE);
+       printf("  initial heap size   : %d\n", HEAP_STARTSIZE);
+       printf("  stack size          : %d\n", STACK_SIZE);
+       puts("  java.boot.class.path: "CACAO_VM_ZIP_PATH":"CLASSPATH_GLIBJ_ZIP_PATH"");
+       puts("  java.library.path   : "CLASSPATH_LIBRARY_PATH"\n");
+
+       puts("Runtime variables:\n");
+       printf("  maximum heap size   : %d\n", opt_heapmaxsize);
+       printf("  initial heap size   : %d\n", opt_heapstartsize);
+       printf("  stack size          : %d\n", opt_stacksize);
+       printf("  java.boot.class.path: %s\n", bootclasspath);
 }
 
 
@@ -506,8 +512,6 @@ bool vm_create(JavaVMInitArgs *vm_args)
 {
        char *cp;
        s4    cplen;
-       u4    heapmaxsize;
-       u4    heapstartsize;
        s4    opt;
        s4    i, j, k;
 
@@ -585,9 +589,9 @@ bool vm_create(JavaVMInitArgs *vm_args)
        checknull  = false;
        opt_noieee = false;
 
-       heapmaxsize   = HEAP_MAXSIZE;
-       heapstartsize = HEAP_STARTSIZE;
-       opt_stacksize = STACK_SIZE;
+       opt_heapmaxsize   = HEAP_MAXSIZE;
+       opt_heapstartsize = HEAP_STARTSIZE;
+       opt_stacksize     = STACK_SIZE;
 
 
 #if defined(ENABLE_JVMTI)
@@ -750,9 +754,9 @@ bool vm_create(JavaVMInitArgs *vm_args)
                                        j = atoi(opt_arg);
 
                                if (opt == OPT_MX)
-                                       heapmaxsize = j;
+                                       opt_heapmaxsize = j;
                                else if (opt == OPT_MS)
-                                       heapstartsize = j;
+                                       opt_heapstartsize = j;
                                else
                                        opt_stacksize = j;
                        }
@@ -1080,7 +1084,7 @@ bool vm_create(JavaVMInitArgs *vm_args)
 
        /* initialize the garbage collector */
 
-       gc_init(heapmaxsize, heapstartsize);
+       gc_init(opt_heapmaxsize, opt_heapstartsize);
 
 #if defined(ENABLE_INTRP)
        /* Allocate main thread stack on the Java heap. */