Author: Maciej Fijalkowski <[email protected]>
Branch: releasegil-effectinfo
Changeset: r48461:ce357df2a5c2
Date: 2011-07-18 23:45 +0200
http://bitbucket.org/pypy/pypy/changeset/ce357df2a5c2/
Log: Initial JIT test for the manifestation of this issue.
diff --git a/pypy/jit/metainterp/test/test_ajit.py
b/pypy/jit/metainterp/test/test_ajit.py
--- a/pypy/jit/metainterp/test/test_ajit.py
+++ b/pypy/jit/metainterp/test/test_ajit.py
@@ -2619,5 +2619,42 @@
self.meta_interp(f, [], enable_opts='')
self.check_loops(new_with_vtable=1)
+
+ def test_release_gil_flush_heap_cache(self):
+ from pypy.rpython.lltypesystem import rffi
+
+ T = rffi.CArrayPtr(rffi.TIME_T)
+
+ external = rffi.llexternal("time", [T], rffi.TIME_T, threadsafe=True)
+ class Lock(object):
+ @dont_look_inside
+ def acquire(self):
+ external(lltype.nullptr(T.TO))
+ @dont_look_inside
+ def release(self):
+ external(lltype.nullptr(T.TO))
+ def dealloc(self):
+ pass
+ @dont_look_inside
+ def get_lst():
+ return [0]
+ myjitdriver = JitDriver(greens=[], reds=["n", "l", "lock"])
+ def f(n):
+ lock = Lock()
+ l = 0
+ while n > 0:
+ myjitdriver.jit_merge_point(lock=lock, l=l, n=n)
+ x = get_lst()
+ l += len(x)
+ lock.acquire()
+ # Thist must not reuse the previous one.
+ n -= len(x)
+ lock.release()
+ lock.dealloc()
+ return n
+ res = self.meta_interp(f, [10])
+ self.check_loops(arraylen_gc=2)
+
+
class TestLLtype(BaseLLtypeTests, LLJitMixin):
pass
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit