This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Memory leak problem in MSVS6.0 C RTL


It's to bad you had to switch to the dll version.  I wager that approach
will start rippling through your application. Good idea about the _CRTIMP
extern.


--Larry

-----Original Message-----
From: pthreads-win32-owner@sources.redhat.com
[mailto:pthreads-win32-owner@sources.redhat.com]On Behalf Of Mattias
Ernelli
Sent: Wednesday, December 27, 2000 12:41 PM
To: 'Laurence F. Wood'
Cc: Pthreads Win32 (E-mail)
Subject: RE: Memory leak problem in MSVS6.0 C RTL


Intresting, I noticed also that you have renamed the _errno declaration in
pthread.h to _errnoPthread to avoid nameclash with the _errno() declared in
need_errno/errno.h. I get compiletime warnings about inconsistant linkage
specification since in need_errno/errno.h it is declared "_CRTIMP extern int
* _errno( void ); " which when compiled as dll yields dllexport extern int *
_errno( void ).

I was looking for solutions, one is to declare NEED_ERRNO as well as
declaring _MD but it felt awkward since NEED_ERRNO includes need_errno.h
which is just a copy of errno.h.

So I solved it by adding _CRTIMP extern to the declaration in pthread.h.

I wonder if this has been addressed by the pthread-32 comunity before? Or is
everybody ignoring the compiler warning? I do think that the declaration
should go away since its declared in either need_errno.h or errno.h.

Anyway, what I meant about static linking is that our application is is
using the static version of the C RTL (libcmt.lib) not msvcrt.lib, ant that
caused a conflict with the pthread linking of msvcrt.lib/dll. Now I have
changed so that our application links to msvcrt.lib/dll as well, although I
have to recompile pthread depending on whether I need to link to the
debug/release version of msvcrt. Maybe that should be part of the build
system to build a version that links to either release/debug version of the
msvcrt.dll.

//Mattias

-----Original Message-----
From: Laurence F. Wood [mailto:LaurenceWood@SunyataSystems.Com]
Sent: den 22 december 2000 23:35
To: Laurence F. Wood; Bossom, John; 'Mattias Ernelli'
Cc: Pthreads Win32 (E-mail)
Subject: RE: Memory leak problem in MSVS6.0 C RTL


Here is how I have modified pthreads-win32 with _LIB conditional
compilations for building
as a statically linked library. There is a new conditionally compiled
function in pthread.h that is implemented in dll.c.  I use this
implementation successfully to run massively threaded quantum chemistry
codes.  It should be obvious how to make use of the new call from the code
in dll.c.  If this is of use would someone please make certain that this
gets to the correct archive or pthreads development people.

Happy Holiday,

Larry Wood



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]