This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: malloc overrides


On Nov  5 11:11, Corinna Vinschen wrote:
> On Nov  5 04:04, Yaakov S wrote:
> > On 05/11/2009 03:56, Corinna Vinschen wrote:
> > >You can replace malloc with your own implementation, but it has to be a
> > >*working* implementation.  Early in the per-process DLL initialization
> > >there's a call to free(malloc(16)), which is used to figure out if
> > >Cygwin's malloc has been overridden with an application-supplied version
> > >of malloc.  Since your malloc calls exit, this goes down the gutter.  At
> > >this early stage in initialization, Cygwin can't handle the exit call
> > >correctly.
> > >
> > >Unless we can implement a way to figure out if the application provides
> > >malloc without actually calling malloc, the above testcases are bound to
> > >fail.
> > 
> > Thanks for the explanation.  So what are the correct answers to the
> > questions the code is trying to answer?
> 
> Yes and no, in this order :)

Urgh, sorry, I wasn't paying enough attention to the style of the
questions.  Let's try again, please:

  Are we stuck with standard malloc?  No
  Is alloca based on malloc()?        No


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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