Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com Date: Fri, 24 May 2002 20:47:56 -0400 From: Christopher Faylor To: cygwin-developers AT cygwin DOT com Subject: Re: bug in dll_crt0_1()? Message-ID: <20020525004756.GB19249@redhat.com> Reply-To: cygwin-developers AT cygwin DOT com Mail-Followup-To: cygwin-developers AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23.1i On Fri, May 24, 2002 at 11:51:36AM +1000, Robert Collins wrote: >Interesting situation: > >I have a function that is called from dll_crt0_1 via > do_global_ctors (&__CTOR_LIST__, 1); >that uses malloc(). Malloc is not ready until malloc_init, called from >heap_init() called from memory_init(), called from ... dll_crt0_1. > >Should the memory_init() occur earlier, or should the global constructor >call memory_init() directly? or should malloc() check that memory_init() >has been called? Adding malloc calls to cygwin's startup code is something that should be given a lot of thought. Ditto, adding ctors. If you're profiling cygwin, I think you'll find that a surprising amount of time is taken up in ctors. cgf