Message262582
| Author |
Kevin Modzelewski |
| Recipients |
Kevin Modzelewski |
| Date |
2016年03月28日.20:07:30 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1459195650.62.0.697543008617.issue26659@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The slice type doesn't participate in GC, which means that if you happen to create a cycle involving a slice, that cycle will never get freed. Here's an example:
def f():
l = []
l.append(slice(l))
# Will consume memory without bound:
while True:
f()
This seems pretty hard to trigger accidentally, so it might not be a huge deal -- especially since it seems to have been around for a while. (I only checked 2.7 and trunk though.)
I think this could be solved by either having the slice class participate in GC (ie add tp_traverse and tp_clear methods), or maybe doing some type-filtering during slice_new(). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年03月28日 20:07:30 | Kevin Modzelewski | set | recipients:
+ Kevin Modzelewski |
| 2016年03月28日 20:07:30 | Kevin Modzelewski | set | messageid: <1459195650.62.0.697543008617.issue26659@psf.upfronthosting.co.za> |
| 2016年03月28日 20:07:30 | Kevin Modzelewski | link | issue26659 messages |
| 2016年03月28日 20:07:30 | Kevin Modzelewski | create |
|