On Thu, Apr 10, 2008 at 10:12 AM, Brian Granger <[EMAIL PROTECTED]> wrote:
> > (I'm not on the SAGE list so not dual-posting)
>  >
>  > > A few of us (ipython and mpi4py devs) are wondering what the
>  >  > best/safest way of allocating dynamic memory in a local scope
>  >  > (method/function) is when using cython.  An example would be if you
>  >  > need an array of c ints that is locally scoped.
>  >  >
>  >  Won't try-finally work here?
>
>  I don't see why it wouldn't.  But, typical usages of sage_malloc are
>  not protected in that way.

Maybe they should be.

Note by the way though that it's a bit tricky since in the finally block you
have to know whether things when wrong and memory has to be freed
or not.

 -- William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to