From: earnie_boyd AT yahoo DOT com (Earnie Boyd) Subject: Re: Linking with Borland C 22 Sep 1998 12:52:31 -0700 Message-ID: <19980922014735.27672.rocketmail.cygnus.gnu-win32@send1b.yahoomail.com> Reply-To: earnie_boyd AT yahoo DOT com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Juergen Bausa , anorland AT hem2 DOT passagen DOT se, gnu-win32 AT cygnus DOT com ---Juergen Bausa wrote: > > > The real problem is to execute a function in a cygnus-made dll, that > uses functions like 'malloc'. I think these functions are not correctly > initialized when the dll is loaded by a non-cygnus program. So, my question > is: Is your example still working if you use this function foo: > > > int foo(int n) > > { > int i; > double *a=malloc(n*sizeof(double)); > > > for(i=0;i i=(int)a[n-1]; > free(a); > > return i; > } > IMHO it is most likely that functions that use malloc within the cygwin.dll or functions built with the cygwin that use malloc routines will always be a problem outside of the cygwin environment. The cygwin malloc emulates the UNIX functions including external variables controlling the size of memory. Since those variables don't exist naturally in Win32, if you expect it to work at all you would have to take care that the external variables were properly initialized and to use the cygwin mmalloc.a library. Others who are more intune with the workings of the cygwin malloc, I'm I wrong with this? If not, what would have to be initialized and how? == - \\||// -----------o0O0--Earnie--0O0o------------ -- earnie_boyd AT yahoo DOT com -- -- http://freeyellow.com/members5/gw32 -- --------------ooo0O--O0ooo--------------- PS: Newbie's, you should visit my page. _________________________________________________________ DO YOU YAHOO!? Get your free @yahoo.com address at http://mail.yahoo.com - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".