#14501: Fix memory allocation problems in data_structures_pyx.pxi
---------------------------------+------------------------------------------
       Reporter:  dcoudert       |         Owner:  joyner      
           Type:  defect         |        Status:  needs_review
       Priority:  major          |     Milestone:  sage-5.10   
      Component:  group theory   |    Resolution:              
       Keywords:                 |   Work issues:              
Report Upstream:  N/A            |     Reviewers:              
        Authors:  David Coudert  |     Merged in:              
   Dependencies:                 |      Stopgaps:              
---------------------------------+------------------------------------------

Comment (by dcoudert):

 > Do you still needs those lines ?
 >
 > {{{
 > sage_free(int_array)
 > sage_free(int_ptrs)
 > }}}

 Yes. They have not yet been assigned to SC.stuff pointers and so must be
 deallocated.
 The other option is to assign these pointers to SC.stuff and let
 {{{SC_dealloc}}} do the job, but then it will enter a for loop. We don't
 need that.

 > Short of this, I think the patch is good to go. I wish there was a nice
 way to avoid this O(n) calloc, but everything I see would make the code
 trickier, and it really doesn't need it `:-P`

 At least calloc is low level implementation and so we may expect it is way
 faster than assignments.

 Thanks,

 D.

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