Message244552
| Author |
arigo |
| Recipients |
arigo |
| Date |
2015年05月31日.18:29:54 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1433096994.94.0.20833461119.issue24340@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The computation of `co_stacksize' by the compiler is known to give only an upper bound estimate. http://bugs.python.org/issue1754094 is an example of fixing a "leak" where every repetition of a statement makes `co_stacksize' bigger by 1. However, in the whole 3.x series (from at least 3.2), the following simple code, which at runtime requires about 4 or 5 stack slots, leaks 14(!) slots for every `try:' block. Maybe this should be improved to reduce the extreme size of the leak.
def g():
try: pass
except ImportError as e: pass
try: pass
except ImportError as e: pass
try: pass
except ImportError as e: pass
...
i.e. any function that is big enough to contain 6 try: blocks in sequence will have its stack size overestimated by about 70. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年05月31日 18:29:54 | arigo | set | recipients:
+ arigo |
| 2015年05月31日 18:29:54 | arigo | set | messageid: <1433096994.94.0.20833461119.issue24340@psf.upfronthosting.co.za> |
| 2015年05月31日 18:29:54 | arigo | link | issue24340 messages |
| 2015年05月31日 18:29:54 | arigo | create |
|