#15506: Fix another "recursion depth exceeded" in memory deallocation for weak
dictionaries
-------------------------------------+-------------------------------------
Reporter: nthiery | Owner:
Type: defect | Status: new
Priority: blocker | Milestone: sage-5.13
Component: performance | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/nbruin/ticket/15506 | 5de9c7c33caab20a44a8ba955d3b12548f2f0c25
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by nbruin):
* commit: => 5de9c7c33caab20a44a8ba955d3b12548f2f0c25
Comment:
This should do the trick for `WeakValueDictionary`. Merge #15367 to get
the same benefit for `MonoDict` and `TripleDict`.
Code that verifies the problem has been solved:
{{{
sage: class A: pass
sage: from sage.misc.weak_dict import WeakValueDictionary
sage: a=A(); prev=a;
sage: M=WeakValueDictionary()
sage: for i in range(10^3+10): newA = A(); M[newA] = prev; prev = newA
sage: del a
}}}
This used to fail, but with the code on this branch it works.
----
New commits:
||[[http://git.sagemath.org/sage.git/commit/?id=5de9c7c|5de9c7c]]||trac
15506: ensure that WeakValueDictionary deletes entries via a list, so that
we benefit from Python's trashcan||
--
Ticket URL: <http://trac.sagemath.org/ticket/15506#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.