2008-02-06 Hans Boehm <Hans.Boehm@hp.com> (mostly from Henning Makholm)
authorhboehm <hboehm>
Thu, 7 Feb 2008 00:58:28 +0000 (00:58 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:42 +0000 (21:06 +0400)
* include/private/gc_priv.h, mark_rts.c, typd_mlc.c:
Add GC_push_typed_structures() to push GC_ext_descriptors.

ChangeLog
include/private/gc_priv.h
mark_rts.c
typd_mlc.c

index 1c4d58b..ff04f5c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-06  Hans Boehm <Hans.Boehm@hp.com> (mostly from Henning Makholm)
+
+       * include/private/gc_priv.h, mark_rts.c, typd_mlc.c:
+       Add GC_push_typed_structures() to push GC_ext_descriptors.
+
 2008-01-31  Hans Boehm <Hans.Boehm@hp.com> (mostly from Andreas Tobler)
 
        * tests/test.c: Call GC_INIT for DARWIN; test system type using
index c0a7108..1d96d87 100644 (file)
@@ -1403,6 +1403,9 @@ extern void GC_push_gc_structures(void);
 #      ifdef THREADS
          extern void GC_push_thread_structures (void);
 #      endif
+       extern void (*GC_push_typed_structures) (void);
+                       /* A pointer such that we can avoid linking in  */
+                       /* the typed allocation support if unused.      */
 extern void (*GC_start_call_back) (void);
                        /* Called at start of full collections.         */
                        /* Not called if 0.  Called with allocation     */
index 05ece1c..0def44f 100644 (file)
@@ -511,6 +511,8 @@ void GC_push_current_stack(ptr_t cold_gc_frame, void * context)
 #   endif /* !THREADS */
 }
 
+void (*GC_push_typed_structures) (void) = NULL;
+
 /*
  * Push GC internal roots.  Only called if there is some reason to believe
  * these would not otherwise get registered.
@@ -521,6 +523,8 @@ void GC_push_gc_structures(void)
 #   if defined(THREADS)
       GC_push_thread_structures();
 #   endif
+    if( GC_push_typed_structures )
+      GC_push_typed_structures();
 }
 
 #ifdef THREAD_LOCAL_ALLOC
index 744d938..ae529d3 100644 (file)
@@ -97,6 +97,11 @@ size_t GC_avail_descr = 0;   /* Next available slot.         */
 int GC_typed_mark_proc_index;  /* Indices of my mark           */
 int GC_array_mark_proc_index;  /* procedures.                  */
 
+static void GC_push_typed_structures_proc (void)
+{
+  GC_push_all((ptr_t)&GC_ext_descriptors, (ptr_t)&GC_ext_descriptors + sizeof(word));
+}
+
 /* Add a multiword bitmap to GC_ext_descriptors arrays.  Return        */
 /* starting index.                                             */
 /* Returns -1 on failure.                                      */
@@ -116,10 +121,12 @@ signed_word GC_add_ext_descriptor(GC_bitmap bm, word nbits)
        size_t new_size;
        word ed_size = GC_ed_size;
        
-       UNLOCK();
        if (ed_size == 0) {
+           GC_push_typed_structures = GC_push_typed_structures_proc;
+           UNLOCK();
            new_size = ED_INITIAL_SIZE;
        } else {
+           UNLOCK();
            new_size = 2 * ed_size;
            if (new_size > MAX_ENV) return(-1);
        }