[Python-Dev] Python + Visual C++ 8.0?

"Martin v. Löwis" martin at v.loewis.de
Thu Dec 29 00:19:29 CET 2005


Ralf W. Grosse-Kunstleve wrote:
> However, we don't have any home-grown
> C++ GUI code. Could it be that problems due to mixing objects from different
> compiler versions are restricted to certain areas, like GUI libraries?

Well, yes: the areas are
- memory management
- stdio
- locales
for the C library; for the C++, I'm not so sure, but I think one of the
areas is
- static members of class templates, in particular in STL containers

In all these cases, global variables exist twice if you have two copies
of the library defining them in your address space. If you pass objects
around from one library to the other, the other library may operate on
the wrong global variable.

To give some examples:
- memory management: if you malloc() with one library, and free() with
  the other, the memory will be "mostly" leak (i.e. not be reused by
  the malloc() of the first library); the consequence is not a crash,
  but a memory leak, in certain applications
- stdio: if you fprintf to a stdout of a different library, the library
  will crash (GPF)
- static members of class templates: I think it is the rb_tree template
  which will not find its data correctly (but my memory is weak here)

Regards,
Martin


More information about the Python-Dev mailing list