Commits

Maciej Fijalkowski committed 7c1a5cf

write a test and kill assert

Comments (0)

Files changed (2)

pypy/rpython/memory/gc/minimark.py

             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))

pypy/rpython/memory/gc/test/test_direct.py

         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