0.9.0.37:
[sbcl.git] / src / runtime / cheneygc.c
index fc003f5..4948da8 100644 (file)
@@ -237,7 +237,10 @@ collect_garbage(unsigned ignore)
     printf("Flipping spaces ...\n");
 #endif
 
-    os_zero((os_vm_address_t) current_dynamic_space,
+    /* Maybe FIXME: it's possible that we could significantly reduce 
+     * 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);
 
     current_dynamic_space = new_space;
@@ -248,6 +251,8 @@ collect_garbage(unsigned ignore)
 #endif
     size_retained = (new_space_free_pointer - new_space) * sizeof(lispobj);
 
+    os_flush_icache((os_vm_address_t)new_space, size_retained);
+
     /* Zero stack. */
 #ifdef PRINTNOISE
     printf("Zeroing empty part of control stack ...\n");
@@ -280,10 +285,6 @@ collect_garbage(unsigned ignore)
        
     printf("%10.2f M bytes/sec collected.\n", gc_rate);
 #endif
-    /* os_flush_icache((os_vm_address_t) 0, sizeof(unsigned long)); */
-    /* Maybe FIXME: it's possible that we could significantly reduce 
-     * RSS by zeroing the from_space or madvise(MADV_DONTNEED) or 
-     * similar os-dependent tricks here */
 }
 
 \f
@@ -419,8 +420,6 @@ void scavenge_interrupt_contexts(void)
     os_context_t *context;
 
     struct thread *th=arch_os_get_current_thread();
-    struct interrupt_data *data=
-       th ? th->interrupt_data : global_interrupt_data;
 
     index = fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,0));
 
@@ -531,9 +530,9 @@ search_read_only_space(void *pointer)
     lispobj* end = (lispobj*)SymbolValue(READ_ONLY_SPACE_FREE_POINTER,0);
     if ((pointer < (void *)start) || (pointer >= (void *)end))
        return NULL;
-    return (search_space(start, 
-                        (((lispobj *)pointer)+2)-start, 
-                        (lispobj *)pointer));
+    return (gc_search_space(start, 
+                           (((lispobj *)pointer)+2)-start, 
+                           (lispobj *)pointer));
 }
 
 lispobj *
@@ -543,9 +542,9 @@ search_static_space(void *pointer)
     lispobj* end = (lispobj*)SymbolValue(STATIC_SPACE_FREE_POINTER,0);
     if ((pointer < (void *)start) || (pointer >= (void *)end))
        return NULL;
-    return (search_space(start, 
-                        (((lispobj *)pointer)+2)-start, 
-                        (lispobj *)pointer));
+    return (gc_search_space(start, 
+                           (((lispobj *)pointer)+2)-start, 
+                           (lispobj *)pointer));
 }
 
 lispobj *
@@ -555,9 +554,9 @@ search_dynamic_space(void *pointer)
     lispobj *end = (lispobj *) dynamic_space_free_pointer;
     if ((pointer < (void *)start) || (pointer >= (void *)end))
        return NULL;
-    return (search_space(start, 
-                        (((lispobj *)pointer)+2)-start, 
-                        (lispobj *)pointer));
+    return (gc_search_space(start, 
+                           (((lispobj *)pointer)+2)-start, 
+                           (lispobj *)pointer));
 }
 \f
 /* initialization.  if gc_init can be moved to after core load, we could