[pypy-commit] pypy gc-minimark-pinning: write a test and kill assert

fijal noreply at buildbot.pypy.org
Sun Apr 15 20:29:42 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: gc-minimark-pinning
Changeset: r54374:7c1a5cf25df8
Date: 2012-04-15 19:09 +0200
http://bitbucket.org/pypy/pypy/changeset/7c1a5cf25df8/

Log:	write a test and kill assert

diff --git a/pypy/rpython/memory/gc/minimark.py b/pypy/rpython/memory/gc/minimark.py
--- a/pypy/rpython/memory/gc/minimark.py
+++ b/pypy/rpython/memory/gc/minimark.py
@@ -1502,7 +1502,6 @@
             if hdr.tid & GCFLAG_VISITED:
                 return
             hdr.tid |= GCFLAG_VISITED
-            ll_assert(not self.header(obj).tid & GCFLAG_HAS_SHADOW, "support shadow with pinning")
             ll_assert(not self.header(obj).tid & GCFLAG_HAS_CARDS, "support cards with pinning")
             self.surviving_pinned_objects.insert(
                 llarena.getfakearenaaddress(obj - size_gc_header))
diff --git a/pypy/rpython/memory/gc/test/test_direct.py b/pypy/rpython/memory/gc/test/test_direct.py
--- a/pypy/rpython/memory/gc/test/test_direct.py
+++ b/pypy/rpython/memory/gc/test/test_direct.py
@@ -535,6 +535,15 @@
         two = self.gc.nursery_free
         assert one != two
 
+    def test_pin_shadow(self):
+        s = self.malloc(S)
+        self.stackroots.append(s)
+        self.gc.id(s) # allocate shadow
+        self.gc.pin(llmemory.cast_ptr_to_adr(s))
+        self.gc.minor_collection(1)
+        assert self.gc.nursery_free != self.gc.nursery
+        # we still have a pinned object
+
     def test_writebarrier_before_copy(self):
         from pypy.rpython.memory.gc import minimark
         largeobj_size =  self.gc.nonlarge_max + 1


More information about the pypy-commit mailing list