From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15175 invoked by alias); 13 Oct 2004 11:47:31 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 15162 invoked from network); 13 Oct 2004 11:47:31 -0000 Received: from unknown (HELO smtp1.libero.it) (193.70.192.51) by sourceware.org with SMTP; 13 Oct 2004 11:47:31 -0000 Received: from localhost (172.16.1.84) by smtp1.libero.it (7.0.027-DD01) id 40C7315F019AD865; Wed, 13 Oct 2004 13:47:28 +0200 Received: from bagio (151.37.66.24) by smtp20.libero.it (7.0.027-DD01) id 40E3F8E204093D55; Wed, 13 Oct 2004 13:47:20 +0200 Message-ID: <015501c4b11a$6ce74b60$18422597@bagio> From: "Giovanni Bajo" To: "Nick Ing-Simmons" Cc: References: <41698B8A.4050702@tat.physik.uni-tuebingen.de><416B47AA.3010106@codesourcery.com> <87sm8k1orb.fsf@deneb.enyo.de><416B8127.4050903@codesourcery.com> <20041013091948.4367.3@llama.elixent.com> Subject: Re: Optimizing of explicit temporary storage Date: Wed, 13 Oct 2004 13:02:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at libero.it serv5 X-SW-Source: 2004-10/txt/msg00492.txt.bz2 Nick Ing-Simmons wrote: >> it would be surprising to most programmers to optimize away the call >> because malloc *does* have side-effects on real systems. For >> example, on UNIX, it is likely to call sbrk, which result in >> observable changes in the process state. > > Indeed! - I have actually written > > free(malloc(estimated_total_need)); > > To get expensive sbrk() call out of the way with one big one > rather than many smaller ones. So why not calling sbrk() directly? Giovanni Bajo