From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25664 invoked by alias); 23 Oct 2009 14:37:12 -0000 Received: (qmail 25654 invoked by uid 22791); 23 Oct 2009 14:37:12 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Oct 2009 14:37:00 +0000 Received: from wpaz5.hot.corp.google.com (wpaz5.hot.corp.google.com [172.24.198.69]) by smtp-out.google.com with ESMTP id n9NEawh7000815 for ; Fri, 23 Oct 2009 07:36:58 -0700 Received: from yxe27 (yxe27.prod.google.com [10.190.2.27]) by wpaz5.hot.corp.google.com with ESMTP id n9NEasxC028769 for ; Fri, 23 Oct 2009 07:36:56 -0700 Received: by yxe27 with SMTP id 27so8456748yxe.10 for ; Fri, 23 Oct 2009 07:36:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.213.34 with SMTP id p34mr3206814anq.151.1256308614656; Fri, 23 Oct 2009 07:36:54 -0700 (PDT) In-Reply-To: <2D19DCE7-F7F3-4B20-B809-FC1C914644F8@adacore.com> References: <200910231413.50074.pedro@codesourcery.com> <2D19DCE7-F7F3-4B20-B809-FC1C914644F8@adacore.com> Date: Fri, 23 Oct 2009 14:37:00 -0000 Message-ID: <8ac60eac0910230736o6072b2c0kff32e4d4662e6466@mail.gmail.com> Subject: Re: [RFA] little cleanup in allocate_objfile From: Paul Pluzhnikov To: Tristan Gingold Cc: Pedro Alves , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00574.txt.bz2 On Fri, Oct 23, 2009 at 6:23 AM, Tristan Gingold wrote: > Thanks, committed. I've checked in the patch below under the obvious rule. Thanks, -- Paul Pluzhnikov 2009-10-23 Paul Pluzhnikov * objfiles.c (allocate_objfile): Use xzalloc. Index: objfiles.c =================================================================== RCS file: /cvs/src/src/gdb/objfiles.c,v retrieving revision 1.101 diff -u -p -u -r1.101 objfiles.c --- objfiles.c 23 Oct 2009 13:22:46 -0000 1.101 +++ objfiles.c 23 Oct 2009 14:31:27 -0000 @@ -196,8 +196,7 @@ allocate_objfile (bfd *abfd, int flags) { struct objfile *objfile; - objfile = (struct objfile *) xmalloc (sizeof (struct objfile)); - memset (objfile, 0, sizeof (struct objfile)); + objfile = (struct objfile *) xzalloc (sizeof (struct objfile)); objfile->psymbol_cache = bcache_xmalloc (); objfile->macro_cache = bcache_xmalloc (); /* We could use obstack_specify_allocation here instead, but