mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Fix a trivial class of (hypothetical, future) false-positive refleaks, discovered by an optimization in Unladen Swallow's past (which will become CPython's future).
This commit is contained in:
parent
3436064785
commit
ac1d93167c
1 changed files with 3 additions and 2 deletions
|
@ -993,12 +993,13 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
|
||||||
print >> sys.stderr, ("1234567890"*(repcount//10 + 1))[:repcount]
|
print >> sys.stderr, ("1234567890"*(repcount//10 + 1))[:repcount]
|
||||||
dash_R_cleanup(fs, ps, pic, zdc, abcs)
|
dash_R_cleanup(fs, ps, pic, zdc, abcs)
|
||||||
for i in range(repcount):
|
for i in range(repcount):
|
||||||
rc = sys.gettotalrefcount()
|
rc_before = sys.gettotalrefcount()
|
||||||
run_the_test()
|
run_the_test()
|
||||||
sys.stderr.write('.')
|
sys.stderr.write('.')
|
||||||
dash_R_cleanup(fs, ps, pic, zdc, abcs)
|
dash_R_cleanup(fs, ps, pic, zdc, abcs)
|
||||||
|
rc_after = sys.gettotalrefcount()
|
||||||
if i >= nwarmup:
|
if i >= nwarmup:
|
||||||
deltas.append(sys.gettotalrefcount() - rc - 2)
|
deltas.append(rc_after - rc_before)
|
||||||
print >> sys.stderr
|
print >> sys.stderr
|
||||||
if any(deltas):
|
if any(deltas):
|
||||||
msg = '%s leaked %s references, sum=%s' % (test, deltas, sum(deltas))
|
msg = '%s leaked %s references, sum=%s' % (test, deltas, sum(deltas))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue