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

Comment (by nbruin):

 Replying to [comment:32 jpflori]:
 > That would suit as well I guess and sounds kind of like the coerce_to
 solution nils suggested.
 > If we go this way, I guess we should do the same for actions.

 Yes, it strikes me as similar. In fact, because when you're trying to
 figure out a coercion or conversion you usually have both the domain and
 the codomain already, there's no need for weak references.

 See also [http://trac.sagemath.org/ticket/11521#comment:152]

 Note that a map and a homset really do need strong references to domain
 and codomain, because they need both to stay sane. If you want maps with
 weak references to one or the other, you'd have to make a special class
 specifically for use in the coercion system. Note that such maps would
 often essentially reference elements (at least in the codomain), so a
 strong reference to to codomain is probably unavoidable in almost all
 cases.

 Once a coercion or a conversion is discovered, how do we decide where to
 cache it? Do domain and codomain need a ranking and store the map on the
 domain only if it's ranks strictly higher? We'd have
 `ZZ, QQ, SR` of rank 0. Different float rings rank 1, polynomial rings of
 rank (base) + 1 etc. something like that? Perhaps the coercion
 "construction" hierarchy is of use for this?

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