[pypy-commit] pypy stm-gc: Debugging.

arigo noreply at buildbot.pypy.org
Tue Apr 17 19:23:57 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r54481:4643020b9d08
Date: 2012-04-17 19:23 +0200
http://bitbucket.org/pypy/pypy/changeset/4643020b9d08/

Log:	Debugging.

diff --git a/pypy/rpython/memory/gc/stmtls.py b/pypy/rpython/memory/gc/stmtls.py
--- a/pypy/rpython/memory/gc/stmtls.py
+++ b/pypy/rpython/memory/gc/stmtls.py
@@ -304,6 +304,8 @@
         it was not done so far.
         """
         obj = root.address[0]
+        size = self.gc.get_size(obj)
+        # ^^^ moved here in order to crash early if 'obj' is invalid
         hdr = self.gc.header(obj)
         #
         # If 'obj' is not in the nursery, we set GCFLAG_VISITED
@@ -327,7 +329,6 @@
             #
             # Case of GCFLAG_HAS_SHADOW.  See comments below.
             size_gc_header = self.gc.gcheaderbuilder.size_gc_header
-            size = self.gc.get_size(obj)
             totalsize = size_gc_header + size
             hdr.tid &= ~GCFLAG_HAS_SHADOW
             newobj = hdr.version
@@ -345,7 +346,6 @@
             # First visit to 'obj': we must move this YOUNG obj out of the
             # nursery.
             size_gc_header = self.gc.gcheaderbuilder.size_gc_header
-            size = self.gc.get_size(obj)
             totalsize = size_gc_header + size
             #
             # Common case: allocate a new nonmovable location for it.


More information about the pypy-commit mailing list