#10257: Improve memory functions
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:  tba
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.5
      Component:  c_lib              |   Resolution:
       Keywords:  malloc             |    Merged in:
  sage_malloc                        |    Reviewers:
        Authors:  Jeroen Demeyer     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  f81f34909df2a6b2fba91c895b81ce66f8066435
  u/jdemeyer/ticket/10257            |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Jeroen Demeyer', 'oldvalue': ''}):

 * status:  new => needs_review
 * commit:   => f81f34909df2a6b2fba91c895b81ce66f8066435
 * author:   => Jeroen Demeyer


Old description:

> We should use `sage_malloc()`/`sage_free()` everywhere instead of plain
> `malloc()`/`free()`.
>
> We should also introduce `_check` variants which `raise MemoryError` upon
> failure.
>
> I also propose to add a BSD-inspired [http://www.openbsd.org/cgi-
> bin/man.cgi/OpenBSD-current/man3/calloc.3?query=reallocarray&arch=i386
> sage_reallocarray()] function.

New description:

 We should introduce `check_` variants of the Sage memory functions which
 `raise MemoryError` upon failure.

 I also propose to add a BSD-inspired [http://www.openbsd.org/cgi-
 bin/man.cgi/OpenBSD-current/man3/calloc.3?query=reallocarray&arch=i386
 sage_reallocarray()] function.

 Attached branch introduces the functions and uses them in a few places as
 proof of concept.

--

Comment:

 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=f81f34909df2a6b2fba91c895b81ce66f8066435
 f81f349]||{{{Add memory functions}}}||

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