0.8.7.40:
[sbcl.git] / src / runtime / gc-common.c
index acbadae..26bc938 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <stdio.h>
 #include <signal.h>
+#include <string.h>
 #include "runtime.h"
 #include "sbcl.h"
 #include "os.h"
@@ -112,7 +113,6 @@ copy_object(lispobj object, int nwords)
 {
     int tag;
     lispobj *new;
-    lispobj *source, *dest;
 
     gc_assert(is_lisp_pointer(object));
     gc_assert(from_space_p(object));
@@ -124,18 +124,8 @@ copy_object(lispobj object, int nwords)
     /* Allocate space. */
     new = gc_general_alloc(nwords*4,ALLOC_BOXED,ALLOC_QUICK);
 
-    dest = new;
-    source = (lispobj *) native_pointer(object);
-
     /* Copy the object. */
-    while (nwords > 0) {
-       dest[0] = source[0];
-       dest[1] = source[1];
-       dest += 2;
-       source += 2;
-       nwords -= 2;
-    }
-
+    memcpy(new,native_pointer(object),nwords*4);
     return make_lispobj(new,tag);
 }
 
@@ -144,14 +134,12 @@ static int scav_lose(lispobj *where, lispobj object); /* forward decl */
 /* FIXME: Most calls end up going to some trouble to compute an
  * 'n_words' value for this function. The system might be a little
  * simpler if this function used an 'end' parameter instead. */
-
 void
 scavenge(lispobj *start, long n_words)
 {
     lispobj *end = start + n_words;
     lispobj *object_ptr;
     int n_words_scavenged;
-    
     for (object_ptr = start;
         object_ptr < end;
         object_ptr += n_words_scavenged) {
@@ -327,7 +315,7 @@ trans_code(struct code *code)
                
        /* fix self pointer. */
        nfheaderp->self =
-#ifdef LISP_FEATURE_GENCGC     /* GENCGC?  Maybe x86 is better conditional  */
+#ifdef LISP_FEATURE_X86
            FUN_RAW_ADDR_OFFSET +
 #endif
            nfheaderl;