[pypy-commit] stmgc gc-small-uniform: A test specifically for the synchronization missing on small objs
arigo
noreply at buildbot.pypy.org
Tue Apr 8 20:31:25 CEST 2014
Author: Armin Rigo <arigo at tunes.org>
Branch: gc-small-uniform
Changeset: r1141:390e71973114
Date: 2014-04-07 18:26 +0200
http://bitbucket.org/pypy/stmgc/changeset/390e71973114/
Log: A test specifically for the synchronization missing on small objs
diff --git a/c7/test/test_nursery.py b/c7/test/test_nursery.py
--- a/c7/test/test_nursery.py
+++ b/c7/test/test_nursery.py
@@ -197,3 +197,30 @@
self.start_transaction()
assert lib.stm_can_move(old) == 0
+
+ def test_synchronize_small_obj(self):
+ # make a shared page, and privatize it
+ self.start_transaction()
+ new = stm_allocate(16)
+ self.push_root(new)
+ self.commit_transaction()
+ new = self.pop_root()
+ self.push_root(new)
+
+ self.start_transaction()
+ stm_set_char(new, 'A')
+ self.commit_transaction()
+
+ # make a new object of the same size, which should end in the
+ # same page
+ self.start_transaction()
+ new2 = stm_allocate(16)
+ stm_set_char(new2, 'a')
+ self.push_root(new2)
+ self.commit_transaction()
+ new2 = self.pop_root()
+
+ # check that this new object was correctly sychronized
+ self.switch(1)
+ self.start_transaction()
+ assert stm_get_char(new2) == 'a'
More information about the pypy-commit
mailing list