0.8.10.32:
[sbcl.git] / src / runtime / purify.c
index db80505..cc8496e 100644 (file)
@@ -19,9 +19,9 @@
 #include <strings.h>
 #include <errno.h>
 
+#include "sbcl.h"
 #include "runtime.h"
 #include "os.h"
-#include "sbcl.h"
 #include "globals.h"
 #include "validate.h"
 #include "interrupt.h"
 
 #define PRINTNOISE
 
-#if defined(LISP_FEATURE_X86)
-/* again, what's so special about the x86 that this is differently
- * visible there than on other platforms? -dan 20010125 
+#if defined(LISP_FEATURE_GENCGC)
+/* this is another artifact of the poor integration between gencgc and
+ * the rest of the runtime: on cheney gc there is a global
+ * dynamic_space_free_pointer which is valid whenever foreign function
+ * call is active, but in gencgc there's no such variable and we have
+ * to keep our own
  */
 static lispobj *dynamic_space_free_pointer;
 #endif
@@ -113,7 +116,8 @@ dynamic_pointer_p(lispobj ptr)
 #endif
 }
 
-static inline newspace_alloc(int nwords, int constantp) 
+static inline lispobj *
+newspace_alloc(int nwords, int constantp) 
 {
     lispobj *ret;
     nwords=CEILING(nwords,2);
@@ -735,7 +739,11 @@ ptrans_code(lispobj thing)
     pscav_later(&new->debug_info, 1);
 
     /* FIXME: why would this be a fixnum? */
-    if (!(new->trace_table_offset & (EVEN_FIXNUM_LOWTAG|ODD_FIXNUM_LOWTAG)))
+    /* "why" is a hard word, but apparently for compiled functions the
+       trace_table_offset contains the length of the instructions, as
+       a fixnum.  See CODE-INST-AREA-LENGTH in
+       src/compiler/target-disassem.lisp.  -- CSR, 2004-01-08 */
+    if (!(fixnump(new->trace_table_offset)))
 #if 0
        pscav(&new->trace_table_offset, 1, 0);
 #else
@@ -852,7 +860,7 @@ ptrans_list(lispobj thing, boolean constant)
     struct cons *old, *new, *orig;
     int length;
 
-    orig = newspace_alloc(0,constant);
+    orig = (struct cons *) newspace_alloc(0,constant);
     length = 0;
 
     do {
@@ -1475,7 +1483,7 @@ purify(lispobj static_roots, lispobj read_only_roots)
     SetSymbolValue(READ_ONLY_SPACE_FREE_POINTER, (lispobj)read_only_free,0);
     SetSymbolValue(STATIC_SPACE_FREE_POINTER, (lispobj)static_free,0);
 
-#if !defined(LISP_FEATURE_X86)
+#if !defined(ALLOCATION_POINTER)
     dynamic_space_free_pointer = current_dynamic_space;
     set_auto_gc_trigger(bytes_consed_between_gcs);
 #else