#18763: COIN backend should support basis status and tableau data functions
-------------------------------------+-------------------------------------
       Reporter:  mkoeppe            |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.8
      Component:  numerical          |   Resolution:
       Keywords:  lp                 |    Merged in:
        Authors:  Yuan Zhou          |    Reviewers:  Vincent Delecroix
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/yzh/coin_backend_should_support_basis_status_and_tableau_data_functions|  
3644950e0be45eb124c55931b57098415bbe7b21
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Hi Yuan,

 Replying to [comment:7 yzh]:
 > > Instead of `sage_malloc` you could use `check_malloc` (that checks
 that the memory is indeed allocated and raises an error if not).
 > >
 > Thanks a lot for reviewing the ticket.
 > Does one call `sage_free` to free the memory allocated by
 `check_malloc`?
 > Since `sage_malloc` is used throughout the file, I was trying to be
 consistent. Would you suggest replacing them all by `check_malloc`? Or
 perhaps better to update them using #18868?

 I do not think that #18868 is good idea in this case. You will create a
 Python object for nothing.

 `check_malloc` is equivalent to `sage_malloc` except that it will raise an
 error in case the memory was not allocated (where `sage_malloc` just
 returns `NULL`). So the memory should be freed with `sage_free`. You can
 safely replace occurrences of `sage_malloc` by `check_malloc`. Moreover
 you can always replace
 {{{
 my_ptr = sage_malloc(12)
 if my_ptr == NULL:
     raise MemoryError("allocation failed")
 }}}
 by
 {{{
 my_ptr = check_malloc(12)
 }}}

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/18763#comment:9>
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/d/optout.

Reply via email to