releasing memory to malloc

John Machin sjmachin at lexicon.net
Tue Sep 26 21:43:25 EDT 2006


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