Author: Remi Meier
Branch: c7
Changeset: r655:0624b1cef158
Date: 2014-01-21 10:15 +0100
http://bitbucket.org/pypy/stmgc/changeset/0624b1cef158/
Log: failing test for writing to 2nd page of an object
diff --git a/c7/test/test_basic.py b/c7/test/test_basic.py
--- a/c7/test/test_basic.py
+++ b/c7/test/test_basic.py
@@ -347,11 +347,38 @@
assert is_in_nursery(new)
stm_push_root(new)
stm_minor_collect()
- stm_minor_collect()
new = stm_pop_root()
assert not is_in_nursery(new)
+
+ def test_large_obj_write(self):
+ # test obj which doesn't fit into the size_classes
+ # expects: LARGE_OBJECT_WORDS 36
+ size_class = 1000 # too big
+ obj_size = size_class * 8
+ assert obj_size > 4096 # we want more than 1 page
+ assert obj_size < 4096 * 1024 # in the nursery
+
+ stm_start_transaction()
+ new = stm_allocate(obj_size)
+ assert is_in_nursery(new)
+ stm_push_root(new)
+ stm_stop_transaction()
+ new = stm_pop_root()
+
+ stm_start_transaction()
+ stm_write(new)
+ # write to 2nd page of object!!
+ wnew = stm_get_real_address(new)
+ wnew[4097] = 'x'
+
+ self.switch(1)
+ stm_start_transaction()
+ stm_read(new)
+ rnew = stm_get_real_address(new)
+ assert rnew[4097] == '\0'
+
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit