[pypy-commit] pypy gc-incminimark-pinning: added failing test that shouldn't fail.
groggi
noreply at buildbot.pypy.org
Mon Jun 2 17:24:03 CEST 2014
Author: Gregor Wegberg <code at gregorwegberg.com>
Branch: gc-incminimark-pinning
Changeset: r71823:da5833a62ffa
Date: 2014-05-14 16:16 +0200
http://bitbucket.org/pypy/pypy/changeset/da5833a62ffa/
Log: added failing test that shouldn't fail.
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
@@ -97,6 +97,24 @@
# ^^^ should not be possible, struct is already old and won't
# move.
+ def test_pin_malloc_pin(self):
+ first_ptr = self.malloc(S)
+ first_ptr.someInt = 101
+ self.stackroots.append(first_ptr)
+ assert self.gc.pin(llmemory.cast_ptr_to_adr(first_ptr))
+
+ self.gc.collect()
+ assert first_ptr.someInt == 101
+
+ second_ptr = self.malloc(S)
+ second_ptr.someInt = 102
+ self.stackroots.append(second_ptr)
+ assert self.gc.pin(llmemory.cast_ptr_to_adr(second_ptr))
+
+ self.gc.collect()
+ assert first_ptr.someInt == 101
+ assert second_ptr.someInt == 102
+
# XXX test/define what happens if we try to pin an object that is too
# big for the nursery and will be raw-malloc'ed.
More information about the pypy-commit
mailing list