How to build extensions on Windows?
filipwasilewski at gmail.com
Thu Sep 7 23:12:05 CEST 2006
Jarek Zgoda wrote:
> Filip Wasilewski napisa³(a):
> > There is an easy way to build Python extensions on Windows with MinGW
> > and it works fine for me. Just follow these steps:
> It was brougt to my attention that mingw-compiled extensions for Python
> 2.4 use other malloc() that Python 2.4, is it true? Can this have any
> impact on stability?
I have inspected the dll dependencies for python24.dll (ActiveState
build, but I think this is also true for regular one) and my custom
extensions built with MinGW and both of them use malloc() from
msvcr71.dll. I think that as long as the extensions are linked against
proper version of msvcr (7.1) there should not be such surprises.
Other thing is that Python uses it's own memory allocator  and to
avoid problems with memory corruption one should not try to allocate
memory with PyMem_Malloc() and free it with free() and so forth.
More information about the Python-list