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
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to