From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20071 invoked by alias); 19 Apr 2011 07:46:46 -0000 Received: (qmail 20052 invoked by uid 22791); 19 Apr 2011 07:46:45 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Apr 2011 07:46:29 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3J7kStj026649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Apr 2011 03:46:29 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3J7kS40005868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Apr 2011 03:46:28 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (localhost.localdomain [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id p3J7kRqt031278; Tue, 19 Apr 2011 09:46:27 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id p3J7kRrZ031276; Tue, 19 Apr 2011 09:46:27 +0200 Date: Tue, 19 Apr 2011 08:15:00 -0000 From: Jakub Jelinek To: Janne Blomqvist Cc: Steve Kargl , Fortran List , GCC Patches Subject: Re: [Patch, fortran] Use xcalloc instead of gfc_getmem Message-ID: <20110419074627.GG17079@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek References: <20110418205028.GA54731@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg01489.txt.bz2 On Tue, Apr 19, 2011 at 10:41:33AM +0300, Janne Blomqvist wrote: > On Mon, Apr 18, 2011 at 23:50, Steve Kargl > wrote: > > On Mon, Apr 18, 2011 at 11:41:33PM +0300, Janne Blomqvist wrote: > >> Hi, > >> > >> the attached patch replaces gfc_getmem with calls to xcalloc (from > >> libiberty). Apart from reducing duplicated code, calloc is better than > >> malloc + memset, as the allocator knows that the kernel always gives > >> out zeroed pages so in some cases it can avoid memset'in the area. > >> > >> Regtested on x86_64-unknown-linux-gnu, Ok for trunk? > >> > > > > OK. > > Thanks; I'll commit it later today when I get home. Please don't. You should be using macros from libiberty.h like rest of gcc instead. So instead of xcalloc use XCNEW, XCNEWVEC or XCNEWVAR and remove the casts. Jakub