X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Thu, 5 Nov 2009 11:19:24 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: malloc overrides
Message-ID: <20091105101924.GM26344@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4AF29EC2.2050808@users.sourceforge.net>  <20091105095629.GK26344@calimero.vinschen.de>  <4AF2A33F.30601@users.sourceforge.net>  <20091105101136.GL26344@calimero.vinschen.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20091105101136.GL26344@calimero.vinschen.de>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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

