0.9.18.33:
[sbcl.git] / src / runtime / cheneygc.c
index 2fe298c..0f7d38b 100644 (file)
@@ -47,7 +47,6 @@ lispobj *new_space;
 lispobj *new_space_free_pointer;
 
 static void scavenge_newspace(void);
-static void scavenge_interrupt_contexts(void);
 
 extern unsigned long bytes_consed_between_gcs;
 
@@ -109,7 +108,7 @@ lispobj  copy_large_object(lispobj object, long nwords) {
  * last_generation argument. That's meaningless for us, since we're
  * not a generational GC. So we ignore it. */
 void
-collect_garbage(unsigned ignore)
+collect_garbage(generation_index_t ignore)
 {
 #ifdef PRINTNOISE
     struct timeval start_tv, stop_tv;
@@ -223,11 +222,16 @@ collect_garbage(unsigned ignore)
 
     /* Scan the weak pointers. */
 #ifdef PRINTNOISE
+    printf("Scanning weak hash tables ...\n");
+#endif
+    scan_weak_hash_tables();
+
+    /* Scan the weak pointers. */
+#ifdef PRINTNOISE
     printf("Scanning weak pointers ...\n");
 #endif
     scan_weak_pointers();
 
-
     /* Flip spaces. */
 #ifdef PRINTNOISE
     printf("Flipping spaces ...\n");
@@ -237,7 +241,7 @@ collect_garbage(unsigned ignore)
      * RSS by zeroing the from_space or madvise(MADV_DONTNEED) or
      * similar os-dependent tricks here */
     os_zero((os_vm_address_t) from_space,
-            (os_vm_size_t) DYNAMIC_SPACE_SIZE);
+            (os_vm_size_t) dynamic_space_size);
 
     current_dynamic_space = new_space;
     dynamic_space_free_pointer = new_space_free_pointer;
@@ -297,6 +301,7 @@ scavenge_newspace(void)
                 here,new_space_free_pointer); */
         next = new_space_free_pointer;
         scavenge(here, next - here);
+        scav_weak_hash_tables();
         here = next;
     }
     /* printf("done with newspace\n"); */
@@ -490,20 +495,6 @@ print_garbage(lispobj *from_space, lispobj *from_space_free_pointer)
 }
 
 \f
-/* vector-like objects */
-
-static long
-scav_vector(lispobj *where, lispobj object)
-{
-    if (HeaderValue(object) == subtype_VectorValidHashing) {
-        *where =
-            (subtype_VectorMustRehash<<N_WIDETAG_BITS) | SIMPLE_VECTOR_WIDETAG;
-    }
-
-    return 1;
-}
-
-\f
 /* weak pointers */
 
 #define WEAK_POINTER_NWORDS \
@@ -562,7 +553,6 @@ void
 gc_init(void)
 {
     gc_init_tables();
-    scavtab[SIMPLE_VECTOR_WIDETAG] = scav_vector;
     scavtab[WEAK_POINTER_WIDETAG] = scav_weak_pointer;
 }
 
@@ -599,7 +589,7 @@ void set_auto_gc_trigger(os_vm_size_t dynamic_usage)
              (unsigned long)((os_vm_address_t)dynamic_space_free_pointer
                              - (os_vm_address_t)current_dynamic_space));
 
-    length = os_trunc_size_to_page(DYNAMIC_SPACE_SIZE - dynamic_usage);
+    length = os_trunc_size_to_page(dynamic_space_size - dynamic_usage);
     if (length < 0)
         lose("set_auto_gc_trigger: tried to set gc trigger too high! (0x%08lx)\n",
              (unsigned long)dynamic_usage);
@@ -622,7 +612,7 @@ void clear_auto_gc_trigger(void)
         return;
 
     addr = (os_vm_address_t)current_auto_gc_trigger;
-    length = DYNAMIC_SPACE_SIZE + (os_vm_address_t)current_dynamic_space - addr;
+    length = dynamic_space_size + (os_vm_address_t)current_dynamic_space - addr;
 
 #if defined(SUNOS) || defined(SOLARIS)
     /* don't want to force whole space into swapping mode... */