Author: Gregor Wegberg <[email protected]>
Branch: gc-incminimark-pinning
Changeset: r71825:50ae1687bc68
Date: 2014-05-16 13:09 +0200
http://bitbucket.org/pypy/pypy/changeset/50ae1687bc68/

Log:    added new test that succeed but must be investigated to know that
        this is not happening by chance.

diff --git a/rpython/memory/gc/test/test_object_pinning.py 
b/rpython/memory/gc/test/test_object_pinning.py
--- a/rpython/memory/gc/test/test_object_pinning.py
+++ b/rpython/memory/gc/test/test_object_pinning.py
@@ -31,6 +31,30 @@
         py.test.raises(Exception,
             self.gc.unpin, llmemory.cast_ptr_to_adr(ptr))
 
+    def test_pin_id(self):
+        ptr = self.malloc(S)
+        adr = llmemory.cast_ptr_to_adr(ptr)
+        self.stackroots.append(ptr)
+        ptr.someInt = 100
+        assert self.gc.pin(adr)
+        # XXX incminimark: leads to a shadow.
+        # Check if this really works. (groggi)
+        self.gc.id(ptr)
+        self.gc.collect()
+        assert ptr.someInt == 100
+
+    def test_pin_hash(self):
+        ptr = self.malloc(S)
+        adr = llmemory.cast_ptr_to_adr(ptr)
+        self.stackroots.append(ptr)
+        ptr.someInt = 100
+        assert self.gc.pin(adr)
+        # XXX incminimark: leads to a shadow.
+        # Check if this really works. (groggi)
+        self.gc.identityhash(ptr)
+        self.gc.collect()
+        assert ptr.someInt == 100
+
     # XXX test with multiple mallocs, and only part of them is pinned
 
 class TestIncminimark(PinningGCTest):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to