releasing memory to malloc

iker.arizmendi at gmail.com iker.arizmendi at gmail.com
Tue Sep 26 22:00:59 EDT 2006


I happen to have the code for the C library in question, but I don't
think this is the way to go in general.  If there's a way to get Python
to give memory back to the C allocator I can avoid touching the
library at all.

Regards,
Iker

John Machin wrote:
> iker.arizmendi at gmail.com wrote:
> > I can, but the extension is only a thin wrapper around a general
> > purpose C library which is also used independently of Python.
> >
>
> So change the library to use xmalloc etc and add something like this to
> the .h file:
>
> #ifdef PYMEM
> #define xmalloc PyMem_Malloc
> etc
> #else
> #define xmalloc malloc
> etc
> #endif




More information about the Python-list mailing list