#15506: Fix another "recursion depth exceeded" in memory deallocation for weak
dictionaries
-------------------------------------+-------------------------------------
       Reporter:  nthiery            |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.1
      Component:  performance        |   Resolution:
       Keywords:                     |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/nbruin/ticket/15506              |  e23ec990e914edea0cff655ff188716279b33afc
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nbruin):

 Replying to [comment:20 SimonKing]:

 > These are the differences I see with `git diff ticket/15432
 ticket/15506`:
 >
 > - You put certain to-be-deleted things into tuples, in order to use
 Python's trashcan.

 Correct (isn't it a list rather than a tuple? Doesn't matter for our
 purposes, though).

 > - You ''remove'' the `_IterationContext` and replace it by cdef methods.
 So, instead of a context, you have `try: self._enter_iter() ... finally:
 self._exit_iter()`. I suppose that's for speed.

 That's from #15432. It's more than speed: it also saves us from having to
 keep a weakened reference in the IterationContext, so it makes it easier
 to avoid circular references. I was actually surprised to see the
 complication that a context produced here.

 In addition to these changes, #15432 also introduces an WeakKeyDictionary
 eraser class to make it possible to keep a weak reference (and avoid
 circular references).

 I'd recommend just reviewing all of this here and be done with it (unless
 you feel any of this is controversial of course)

--
Ticket URL: <http://trac.sagemath.org/ticket/15506#comment:21>
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.

Reply via email to