From: Nikodemus Siivola Date: Tue, 19 Feb 2008 16:06:34 +0000 (+0000) Subject: 1.0.14.39: make GENCGC gencgc_zero_check=1 proof again X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=c8da65a17084f166068b52716e9dfb525a9ba297;p=sbcl.git 1.0.14.39: make GENCGC gencgc_zero_check=1 proof again * 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. --- diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 3afc1a2..8994024 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -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 diff --git a/version.lisp-expr b/version.lisp-expr index f95cae8..3b66c06 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"