[pypy-commit] pypy stmgc-c8-gcc: test reproducing the problem
Raemi
noreply at buildbot.pypy.org
Thu Sep 17 12:46:48 CEST 2015
Author: Remi Meier <remi.meier at gmail.com>
Branch: stmgc-c8-gcc
Changeset: r79666:7942aa26d427
Date: 2015-09-17 10:58 +0200
http://bitbucket.org/pypy/pypy/changeset/7942aa26d427/
Log: test reproducing the problem
diff --git a/rpython/translator/stm/test/test_ztranslated.py b/rpython/translator/stm/test/test_ztranslated.py
--- a/rpython/translator/stm/test/test_ztranslated.py
+++ b/rpython/translator/stm/test/test_ztranslated.py
@@ -738,3 +738,25 @@
t, cbuilder = self.compile(main)
data = cbuilder.cmdexec('')
assert 'ok!\n' in data
+
+ def test_allocate_noconflict3(self):
+ MAPDICT_CACHE = lltype.GcArray(llmemory.GCREF)
+
+ class CacheEntry(object): pass
+ INVALID_CACHE_ENTRY = CacheEntry()
+
+ class P(): pass
+ pbc = P()
+ pbc.cache = rstm.allocate_noconflict(MAPDICT_CACHE, 5)
+ for i in range(5):
+ pbc.cache[i] = cast_instance_to_gcref(INVALID_CACHE_ENTRY)
+
+ def main(argv):
+ assert cast_gcref_to_instance(CacheEntry, pbc.cache[1]) is INVALID_CACHE_ENTRY
+ #
+ print "ok!"
+ return 0
+
+ t, cbuilder = self.compile(main)
+ data = cbuilder.cmdexec('')
+ assert 'ok!\n' in data
More information about the pypy-commit
mailing list