[python-win32] extension modules and msvc version

Tim Roberts timr at probo.com
Sat Feb 21 19:55:56 CET 2015


On Feb 20, 2015, at 8:41 AM, Zachary Turner <zturner at google.com> wrote:
> 
> Does anyone understand the technical reasons why an extension module must be compiled with the same version of msvc as python itself? Are there any workarounds? It's really quite an inconvenience.
> 
> If the reason is because python27.dll and the extension module free each others' memory, then it seems like this could be solved by having each supply the other with an alloc and free function pointer, and using the correct allocator on each side.

It’s more than just the heaps, although that’s a part of it.  The run-time library contains state held in static variables.  When you have multiple versions of the run-time library, they don’t share that state.  The C variable “stdin”, for example, is a pointer into a static array of file instances.  When you have multiple run-time libraries, there are multiple buffers for “stdin”.  Prints from one user will not be seamlessly integrated with prints from the other.
— 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list