
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2016-03-28 20:07 byKevin Modzelewski, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Messages (3) | |||
|---|---|---|---|
| msg262582 -(view) | Author: Kevin Modzelewski (Kevin Modzelewski) | Date: 2016-03-28 20:07 | |
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(). | |||
| msg262589 -(view) | Author: Philip Dubé (Demur Rumed)* | Date: 2016-03-29 03:50 | |
Implementing tp_traverse & tp_clear seems to runs into complications due to slice_cache | |||
| msg263590 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-04-16 21:54 | |
New changeset879da9400529 by Benjamin Peterson in branch '2.7':add gc support to slice (closes#26659)https://hg.python.org/cpython/rev/879da9400529New changeset9e2176d18965 by Benjamin Peterson in branch '3.5':add gc support to slice (closes#26659)https://hg.python.org/cpython/rev/9e2176d18965New changeset870fcc50f1bd by Benjamin Peterson in branch 'default':merge 3.5 (#26659)https://hg.python.org/cpython/rev/870fcc50f1bd | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:29 | admin | set | github: 70846 |
| 2016-04-16 22:52:29 | martin.panter | set | versions: + Python 3.5 |
| 2016-04-16 21:54:40 | python-dev | set | status: open -> closed nosy: +python-dev messages: +msg263590 resolution: fixed stage: resolved |
| 2016-03-29 22:18:46 | vstinner | set | nosy: +vstinner |
| 2016-03-29 08:16:06 | SilentGhost | set | nosy: +georg.brandl,pitrou,benjamin.peterson,yselivanov |
| 2016-03-29 03:50:32 | Demur Rumed | set | nosy: +Demur Rumed messages: +msg262589 |
| 2016-03-28 20:07:30 | Kevin Modzelewski | create | |