#14058: Weakly reference binary operation codomains
-----------------------------------+----------------------------------------
       Reporter:  robertwb         |         Owner:  rlm         
           Type:  enhancement      |        Status:  needs_review
       Priority:  major            |     Milestone:  sage-5.7    
      Component:  memleak          |    Resolution:              
       Keywords:                   |   Work issues:              
Report Upstream:  N/A              |     Reviewers:              
        Authors:  Robert Bradshaw  |     Merged in:              
   Dependencies:  #12313           |      Stopgaps:              
-----------------------------------+----------------------------------------

Comment (by SimonKing):

 Before posting a reply to Nils' post, here is an example that the
 existence of A and B does not ensure the survival of the pushout of A and
 B. First, attach [attachment:testcoerction.py] into a Sage session. Then:
 {{{
 sage: %attach /home/simon/SAGE/work/memleak/testcoercion.py
 sage: OA = A()
 sage: OB = B()
 sage: cm = sage.structure.element.get_coercion_model()
 sage: OC = cm.explain(OA,OB)
 Coercion on left operand via
     Conversion map:
       From: A
       To:   C
 Coercion on right operand via
     Conversion map:
       From: B
       To:   C
 Arithmetic performed after coercions.
 Result lives in C
 sage: OC.is_coercion_cached(OA)
 True
 sage: OC.is_coercion_cached(OB)
 True
 sage: del OC
 sage: import gc
 sage: _ = gc.collect()
 sage: len([X for X in gc.get_objects() if isinstance(X,C)])
 0
 sage: xc = OA(1)*OB(1)
 sage: isinstance(xc.parent(),C)
 True
 sage: del xc
 sage: _ = gc.collect()
 sage: len([X for X in gc.get_objects() if isinstance(X,C)])
 0
 }}}

 I do believe that this is ''not'' desired behaviour.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14058#comment:15>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to