* src/mm/boehm.c (gc_init): Set GC_all_interior_pointers to 0 and call
authortwisti <none@none>
Wed, 27 Jun 2007 18:35:40 +0000 (18:35 +0000)
committertwisti <none@none>
Wed, 27 Jun 2007 18:35:40 +0000 (18:35 +0000)
GC_INIT very late.

* src/vm/vm.c (vm_create): Initialze the GC before all other
subsystems.

src/mm/boehm.c
src/vm/vm.c

index cf9148d616fb224c844b38e666b455ae92494ee6..42f002b93a3494d25a429cad48d2bc1db7fc5c83 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: boehm.c 7309 2007-02-09 12:51:00Z twisti $
+   $Id: boehm.c 8150 2007-06-27 18:35:40Z twisti $
 
 */
 
@@ -74,36 +74,39 @@ void gc_init(u4 heapmaxsize, u4 heapstartsize)
 {
        size_t heapcurrentsize;
 
-       GC_INIT();
+       /* just to be sure (should be set to 1 by JAVA_FINALIZATION macro) */
 
-       /* set the maximal heap size */
+       GC_java_finalization = 1;
 
-       GC_set_max_heap_size(heapmaxsize);
+       /* Ignore pointers that do not point to the start of an object. */
 
-       /* set the initial heap size */
+       GC_all_interior_pointers = 0;
 
-       heapcurrentsize = GC_get_heap_size();
+       /* suppress warnings */
 
-       if (heapstartsize > heapcurrentsize) {
-               GC_expand_hp(heapstartsize - heapcurrentsize);
-       }
+       GC_set_warn_proc(gc_ignore_warnings);
+
+       /* install a GC notifier */
+
+       GC_finalize_on_demand = 1;
+       GC_finalizer_notifier = finalizer_notify;
 
        /* define OOM function */
 
        GC_oom_fn = gc_out_of_memory;
 
-       /* just to be sure (should be set to 1 by JAVA_FINALIZATION macro) */
+       GC_INIT();
 
-       GC_java_finalization = 1;
+       /* set the maximal heap size */
 
-       /* suppress warnings */
+       GC_set_max_heap_size(heapmaxsize);
 
-       GC_set_warn_proc(gc_ignore_warnings);
+       /* set the initial heap size */
 
-       /* install a GC notifier */
+       heapcurrentsize = GC_get_heap_size();
 
-       GC_finalize_on_demand = 1;
-       GC_finalizer_notifier = finalizer_notify;
+       if (heapstartsize > heapcurrentsize)
+               GC_expand_hp(heapstartsize - heapcurrentsize);
 }
 
 
index 66f36bd10673cc0c552c758ef99f91997e37ce52..9fd61c9ceaf197c69b1f25df2f712c1f94455bbf 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: vm.c 8132 2007-06-22 11:15:47Z twisti $
+   $Id: vm.c 8150 2007-06-27 18:35:40Z twisti $
 
 */
 
@@ -1530,17 +1530,17 @@ bool vm_create(JavaVMInitArgs *vm_args)
 
        vm_initializing = true;
 
+       /* initialize the garbage collector */
+
+       gc_init(opt_heapmaxsize, opt_heapstartsize);
+
 #if defined(ENABLE_THREADS)
-       /* pre-initialize some core thread stuff, like the stopworldlock,
-          thus this has to happen _before_ gc_init()!!! */
+       /* AFTER: gc_init (directly after, as this initializes the
+          stopworldlock lock */
 
        threads_preinit();
 #endif
 
-       /* initialize the garbage collector */
-
-       gc_init(opt_heapmaxsize, opt_heapstartsize);
-
        /* install architecture dependent signal handlers */
 
        if (!signal_init())