Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-09 Thread Robert Bradshaw
On Wed, Aug 8, 2012 at 10:12 PM, Stefan Behnel wrote: > Robert Bradshaw, 09.08.2012 01:45: >> On Tue, Aug 7, 2012 at 2:53 AM, Stefan Behnel wrote: >>> given how ubiquitous manual memory management is in C, I think it would be >>> nice to let Cython generate the exception raising also for C, not on

Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-08 Thread Stefan Behnel
Robert Bradshaw, 09.08.2012 01:45: > On Tue, Aug 7, 2012 at 2:53 AM, Stefan Behnel wrote: >> given how ubiquitous manual memory management is in C, I think it would be >> nice to let Cython generate the exception raising also for C, not only for >> C++. The difference is this: >> >> cdef extern f

Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-08 Thread Robert Bradshaw
On Tue, Aug 7, 2012 at 2:53 AM, Stefan Behnel wrote: > Hi, > > given how ubiquitous manual memory management is in C, I think it would be > nice to let Cython generate the exception raising also for C, not only for > C++. The difference is this: > > cdef extern from "...": > char* make_new

Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-07 Thread Stefan Behnel
mark florisson, 07.08.2012 13:00: > On 7 August 2012 11:59, mark florisson wrote: >> On 7 August 2012 11:44, Stefan Behnel wrote: >>> mark florisson, 07.08.2012 12:33: I'd say write a wrapper function that does the check, or use an object that encapsulates the buffer allocation and functi

Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-07 Thread mark florisson
On 7 August 2012 11:59, mark florisson wrote: > On 7 August 2012 11:44, Stefan Behnel wrote: >> mark florisson, 07.08.2012 12:33: >>> I'd say write a wrapper function that does the check, or use an object >>> that encapsulates the buffer allocation and functions. I'm not sure >>> we'd want extra

Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-07 Thread mark florisson
On 7 August 2012 11:44, Stefan Behnel wrote: > mark florisson, 07.08.2012 12:33: >> I'd say write a wrapper function that does the check, or use an object >> that encapsulates the buffer allocation and functions. I'm not sure >> we'd want extra syntax for this. Calling functions is already >> comp

Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-07 Thread Stefan Behnel
mark florisson, 07.08.2012 12:33: > I'd say write a wrapper function that does the check, or use an object > that encapsulates the buffer allocation and functions. I'm not sure > we'd want extra syntax for this. Calling functions is already > complicated, this will complicate it even further. Funn

Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-07 Thread mark florisson
On 7 August 2012 10:53, Stefan Behnel wrote: > Hi, > > given how ubiquitous manual memory management is in C, I think it would be > nice to let Cython generate the exception raising also for C, not only for > C++. The difference is this: > > cdef extern from "...": > char* make_new_buffer(

[Cython] automatically raise MemoryError on exceptional C return values

2012-08-07 Thread Stefan Behnel
Hi, given how ubiquitous manual memory management is in C, I think it would be nice to let Cython generate the exception raising also for C, not only for C++. The difference is this: cdef extern from "...": char* make_new_buffer() except NULL as MemoryError int append_to_buffer(char