Daniel Stutzbach wrote:
> On Tue, Aug 31, 2010 at 4:54 AM, M.-A. Lemburg <m...@egenix.com> wrote:
> 
>> Is it possible to have multiple versions of the lib C loaded
>> on Windows ?
>>
> 
> Yes, and it's a pretty common situation.   The fopen() that I call within a
> DLL may not be the same fopen() called by another DLL.  When writing a DLL
> for Windows, the API must be designed with the assumption that anything
> returned by the C library cannot be passed a different C library.  For
> example, suppose I a expose a function in my DLL that allocates some memory,
> populates it with useful information, and returns a pointer.  I must also
> supply a function to free the memory.  I cannot ask the caller to simply
> call free(), because their free() may not be using the same heap as my
> malloc().

But isn't exactly that a major problem for Python ?

An extension written for a different MS CRT version would
not be able to safely free a buffer allocated by the Python
DLL.

> Likewise, a FILE * isn't safe to pass around, unless I can guarantee that
> the application really is one big happy family compiled against the same
> version of the C library.

According to the MS document I found this also applies to the OS
environment and handles.

Taking all these things together makes it sound like there's
a rather small chance of actually getting PEP 384 working
across Windows compiler upgrades.

Then again, I haven't heard of many people actually running into
those possible issues.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 27 2010)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2010-08-19: Released mxODBC 3.1.0              http://python.egenix.com/
2010-09-15: DZUG Tagung, Dresden, Germany                  18 days to go

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to