Author: Maciej Fijalkowski <[email protected]>
Branch: fast-slowpath
Changeset: r65680:d580b1cfca30
Date: 2013-07-26 11:06 +0200
http://bitbucket.org/pypy/pypy/changeset/d580b1cfca30/
Log: big oops, fortunately caught by test
diff --git a/rpython/rtyper/lltypesystem/rlist.py
b/rpython/rtyper/lltypesystem/rlist.py
--- a/rpython/rtyper/lltypesystem/rlist.py
+++ b/rpython/rtyper/lltypesystem/rlist.py
@@ -259,10 +259,12 @@
a realloc(). In the common case where we already overallocated enough,
then this is a very fast operation.
"""
+ cond = len(l.items) < newsize
if jit.isconstant(len(l.items)) and jit.isconstant(newsize):
- _ll_list_resize_hint_really(l, newsize, True)
+ if cond:
+ _ll_list_resize_hint_really(l, newsize, True)
else:
- jit.conditional_call(len(l.items) < newsize,
+ jit.conditional_call(cond,
_ll_list_resize_hint_really, l, newsize, True)
l.length = newsize
@@ -273,7 +275,8 @@
"""
cond = newsize < (len(l.items) >> 1) - 5
if jit.isconstant(len(l.items)) and jit.isconstant(newsize):
- _ll_list_resize_hint_really(l, newsize, False)
+ if cond:
+ _ll_list_resize_hint_really(l, newsize, False)
else:
jit.conditional_call(cond, _ll_list_resize_hint_really, l, newsize,
False)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit