C API and memory allocation

Floris Bruynooghe floris.bruynooghe at gmail.com
Thu Dec 18 15:41:40 CET 2008


On Dec 18, 6:43 am, Stefan Behnel <stefan... at behnel.de> wrote:
> Floris Bruynooghe wrote:
> > I'm slightly confused about some memory allocations in the C API.
>
> If you want to reduce the number of things you have to get your head
> around, learn Cython instead of the raw C-API. It's basically Python, does
> all the reference counting for you and also reduces the amount of memory
> handling you have to care about.
>
> http://cython.org/

Sure that is a good choice in some cases.  Not in my case currently
though, it would mean another build dependency on all our build hosts
and I'm just (trying to) stop an existing extension module from
leaking memory, no way I'm going to re-write that from scratch.

But interesting discussion though, thanks!
Floris



More information about the Python-list mailing list