0.7.4.17: Mostly Alpha fixes
[sbcl.git] / src / runtime / gc.c
index 06b8d26..482cf65 100644 (file)
@@ -29,7 +29,6 @@
 
 /* So you need to debug? */
 #define PRINTNOISE
-#define DEBUG_SPACE_PREDICATES
 #if 0
 #define DEBUG_SPACE_PREDICATES
 #define DEBUG_SCAVENGE_VERBOSE
@@ -511,7 +510,9 @@ scavenge_interrupt_context(os_context_t *context)
 #ifdef ARCH_HAS_NPC_REGISTER
        unsigned long npc_code_offset;
 #endif
+#ifdef DEBUG_SCAVENGE_VERBOSE
        fprintf(stderr, "Scavenging interrupt context at 0x%x\n",context);
+#endif
        /* Find the LIP's register pair and calculate its offset */
        /* before we scavenge the context. */
 #ifdef reg_LIP
@@ -535,7 +536,7 @@ scavenge_interrupt_context(os_context_t *context)
                        }
                }
        }
-#endif reg_LIP
+#endif /* reg_LIP */
 
        /* Compute the PC's offset from the start of the CODE */
        /* register. */
@@ -574,7 +575,7 @@ scavenge_interrupt_context(os_context_t *context)
        /* Fix the LIP */
        *os_context_register_addr(context, reg_LIP) =
            *os_context_register_addr(context, lip_register_pair) + lip_offset;
-#endif reg_LIP
+#endif /* reg_LIP */
        
        /* Fix the PC if it was in from space */
        if (from_space_p(*os_context_pc_addr(context)))
@@ -603,7 +604,9 @@ void scavenge_interrupt_contexts(void)
 
     index = fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX));
 
+#ifdef DEBUG_SCAVENGE_VERBOSE
     fprintf(stderr, "%d interrupt contexts to scan\n",index);
+#endif
     for (i = 0; i < index; i++) {
        context = lisp_interrupt_contexts[i];
        scavenge_interrupt_context(context); 
@@ -2250,10 +2253,10 @@ gc_init(void)
 
 void set_auto_gc_trigger(os_vm_size_t dynamic_usage)
 {
-    os_vm_address_t addr=(os_vm_address_t)current_dynamic_space +
-       dynamic_usage;
-    long length =
-       DYNAMIC_SPACE_SIZE + (os_vm_address_t)current_dynamic_space - addr;
+    os_vm_address_t addr=(os_vm_address_t)current_dynamic_space 
+       + dynamic_usage;
+       
+    long length = DYNAMIC_SPACE_SIZE - dynamic_usage;
 
     if (addr < (os_vm_address_t)dynamic_space_free_pointer) {
        fprintf(stderr,
@@ -2261,13 +2264,13 @@ void set_auto_gc_trigger(os_vm_size_t dynamic_usage)
                (unsigned int)dynamic_usage,
                (os_vm_address_t)dynamic_space_free_pointer
                - (os_vm_address_t)current_dynamic_space);
-       return;
+       lose("lost");
     }
     else if (length < 0) {
        fprintf(stderr,
                "set_auto_gc_trigger: tried to set gc trigger too high! (%p)\n",
                dynamic_usage);
-       return;
+       lose("lost");
     }
 
     addr=os_round_up_to_page(addr);