[Python-Dev] pymalloc on Windows

Mark Hammond mhammond@skippinet.com.au
Tue, 19 Mar 2002 00:33:57 +1100


It appears that the _sre and _winreg modules fail to build with
WITH_PYMALLOC defined.

Both are extension modules, and both use the macro versions of the memory
allocator functions - ie, PyObject_NEW etc.

Both fail at link time with, eg:

_winreg.obj : error LNK2001: unresolved external symbol
__PyCore_ObjectMalloc

I assume from previous discussions here that _PyCore_ObjectMalloc is indeed
supposed to be private and not exposed from the main module/dll.

I have patches for both these modules.  However, I wonder if a more
pragmatic option is to expose this core function.  It would allow
PyObject_NEW to continue to work as before.

I also just saw Martin say that some of these macros may define themselves
back to the function anyway making all this moot :)

So - I guess all I am saying is - at the moment, it appears there are at
least a couple fo problems building the core with pymalloc under windows.  I
have patches, but in a short while they may not be necessary :)

FWIW, with 3 PyObject_NEW changes in the Win32 extensions, the COM tests
pass and pythonwin starts up :)

Mark.