#14711: Memleak when creating QuadraticField
-------------------------------------+-------------------------------------
       Reporter:  jpflori            |        Owner:  davidloeffler
           Type:  defect             |       Status:  needs_review
       Priority:  critical           |    Milestone:  sage-5.13
      Component:  number fields      |   Resolution:
       Keywords:  memleak, number    |    Merged in:
  field, QuadraticField              |    Reviewers:
        Authors:  Simon King         |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  05fb569cb132a8c89713021f1f4b25cd2dd7cb1c
  u/SimonKing/ticket/14711           |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 Replying to [comment:103 nbruin]:
 > Replying to [comment:100 SimonKing]:
 > > Let me try to summarise what is (or may be) left to do:
 > >
 > > - Add a section explaining the current weak coercion model, to
 facilitate maintenance,
 > > - Add `_install_coerce_map_from()`.
 > To clarify this point (and it might be helpful to put something along
 these lines in the documentation), ...

 But where?

 > I think the fourth point is desirable because the alternative,
 programmatic solutions via `_coerce_map_from_`, feel much more heavy-
 weight (subclassing a whole parent just to extend `_coerce_map_from_` may
 be appropriate for someone who is concerned with developing sage, but
 seems inappropriate to me for someone who is thinking about using sage to
 do a complicated computation.

 OK. But then, this method should be visible, hence, not starting with an
 underscore.

 > > - Perhaps: Let the string representation of a weakened map consist of
 a warning to not use this map outside of the coercion framework.
 > I think yes: Due to cyclic references, parents will usually survive
 until the next GC, which may be quite a while after the last reference is
 lost. So place where the map becomes liable to turn defunct may be quite
 distant from the place where the map if found to be defunct. People
 deserve a reminder about that.

 OK. Perhaps: If the map is weak but the domain reference is still
 available, then show the map as
 {{{
 """WARNING: This %s map from %s to %s
 may become defunct after the next garbage collection.
 For usage outside of the coercion system, try to create a copy,
 or apply the method `_make_strong_references()`"""%(self._repr_type(),
 self.domain(),self.codomain()
 }}}
 and if the domain is unavailable, then show the map as
 {{{
 "Defunct %s map"%self._repr_type()"
 }}}

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