[Openmcl-cvs-notifications] r13514 - /trunk/source/lisp-kernel/x86-gc.c

gb at clozure.com gb at clozure.com
Fri Mar 12 01:00:23 UTC 2010


Author: gb
Date: Thu Mar 11 19:00:23 2010
New Revision: 13514

Log:
In purify_range(), if we're walking the dynamic area and encounter
an ivector or function before encountering a reference to that ivector/
function and we're copying ivectors/functions to the readonly area,
do the copy at that point.  (We otherwise miss some things that're
forward-referenced and wind up copying them to the static area instead.)

Modified:
    trunk/source/lisp-kernel/x86-gc.c

Modified: trunk/source/lisp-kernel/x86-gc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/x86-gc.c (original)
+++ trunk/source/lisp-kernel/x86-gc.c Thu Mar 11 19:00:23 2010
@@ -2480,7 +2480,7 @@
 void
 purify_range(LispObj *start, LispObj *end, BytePtr low, BytePtr high, area=
 *to, int what, Boolean recursive)
 {
-  LispObj header;
+  LispObj header, pfn;
   unsigned tag;
   natural nwords;
   hash_table_vector_header *hashp;
@@ -2492,6 +2492,13 @@
     } else {
       tag =3D fulltag_of(header);
       if (immheader_tag_p(tag)) {
+        if ((what & PURIFY_IVECTORS) &&
+            (to =3D=3D readonly_area) &&
+            (header_subtag(header) !=3D subtag_macptr) &&
+            ((BytePtr)start >=3D low) &&
+            ((BytePtr)start < high)) {
+          purify_object((LispObj)start,to);
+        }
         start =3D (LispObj *)skip_over_ivector((natural)start, header);
       } else if (nodeheader_tag_p(tag)) {
         nwords =3D header_element_count(header);
@@ -2526,6 +2533,7 @@
           }
           *start++ =3D 0;
         } else {
+          pfn =3D 0;
           if (header_subtag(header) =3D=3D subtag_function) {
 #ifdef X8632
             int skip =3D (unsigned short)(start[1]);
@@ -2536,6 +2544,7 @@
 #else
             int skip =3D (int)(start[1]);
 #endif
+            pfn =3D (LispObj)start;
             start +=3D skip;
             nwords -=3D skip;
           }
@@ -2543,6 +2552,13 @@
           while(nwords--) {
             copy_reference(start, low, high, to, what, recursive);
             start++;
+          }
+          if (((BytePtr)pfn >=3D low) &&
+              ((BytePtr)pfn < high) &&
+              (what & PURIFY_FUNCTIONS) &&
+              (to =3D=3D readonly_area) &&
+              (immutable_function_p(pfn))) {
+            purify_object(pfn, to);
           }
         }
       } else {



More information about the Openmcl-cvs-notifications mailing list