1.0.14.39: make GENCGC gencgc_zero_check=1 proof again
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 19 Feb 2008 16:06:34 +0000 (16:06 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 19 Feb 2008 16:06:34 +0000 (16:06 +0000)
 * 0.9.8.19 moved zeroing from GC time to allocation time, but after
   the point where the check was done -- thus causing the check to
   fail immediately if it was turned on. This commit moves the check
   after the zeroing, so we're good again.

   ...which also means that gencgc_zero_check=1 is not very
   interesting anymore, since the zeroing happens in the immediate
   vicinity of the check.

src/runtime/gencgc.c
version.lisp-expr

index 3afc1a2..8994024 100644 (file)
@@ -673,21 +673,6 @@ gc_alloc_new_region(long nbytes, int unboxed, struct alloc_region *alloc_region)
     ret = thread_mutex_unlock(&free_pages_lock);
     gc_assert(ret == 0);
 
-    /* we can do this after releasing free_pages_lock */
-    if (gencgc_zero_check) {
-        long *p;
-        for (p = (long *)alloc_region->start_addr;
-             p < (long *)alloc_region->end_addr; p++) {
-            if (*p != 0) {
-                /* KLUDGE: It would be nice to use %lx and explicit casts
-                 * (long) in code like this, so that it is less likely to
-                 * break randomly when running on a machine with different
-                 * word sizes. -- WHN 19991129 */
-                lose("The new region at %x is not zero.\n", p);
-            }
-        }
-    }
-
 #ifdef READ_PROTECT_FREE_PAGES
     os_protect(page_address(first_page),
                PAGE_BYTES*(1+last_page-first_page),
@@ -703,6 +688,22 @@ gc_alloc_new_region(long nbytes, int unboxed, struct alloc_region *alloc_region)
     }
 
     zero_dirty_pages(first_page, last_page);
+
+    /* we can do this after releasing free_pages_lock */
+    if (gencgc_zero_check) {
+        long *p;
+        for (p = (long *)alloc_region->start_addr;
+             p < (long *)alloc_region->end_addr; p++) {
+            if (*p != 0) {
+                /* KLUDGE: It would be nice to use %lx and explicit casts
+                 * (long) in code like this, so that it is less likely to
+                 * break randomly when running on a machine with different
+                 * word sizes. -- WHN 19991129 */
+                lose("The new region at %x is not zero (start=%p, end=%p).\n",
+                     p, alloc_region->start_addr, alloc_region->end_addr);
+            }
+        }
+    }
 }
 
 /* If the record_new_objects flag is 2 then all new regions created
index f95cae8..3b66c06 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.14.38"
+"1.0.14.39"