From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13376 invoked by alias); 3 Nov 2009 20:21:04 -0000 Received: (qmail 13366 invoked by uid 22791); 3 Nov 2009 20:21:03 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Nov 2009 20:21:00 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 641BD10EA3; Tue, 3 Nov 2009 20:20:59 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 5453E1086A; Tue, 3 Nov 2009 20:20:59 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1N5PsA-00066y-35; Tue, 03 Nov 2009 15:20:58 -0500 Date: Tue, 03 Nov 2009 20:21:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: FYI: minor simplification in add_psymbol_to_bcache Message-ID: <20091103202058.GA23081@caradoc.them.org> Mail-Followup-To: Tom Tromey , gdb-patches@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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-11/txt/msg00067.txt.bz2 On Tue, Nov 03, 2009 at 01:10:24PM -0700, Tom Tromey wrote: > This patch changes add_psymbol_to_bcache in two ways. > > First, it removes the gratuitous use of a 'static' local variable. It adds a memset... if you assume that this is a hot function, then it was probably avoided on purpose. On the other hand, the way it's implemented is quite dodgy; there will be bogus padding if sizeof (long) != sizeof (CORE_ADDR) and you alternate adding symbols with VAL and COREADDR set. > Second, it removes the copying of 'name'. I think this copy is not > needed because SYMBOL_SET_NAMES handles this case itself. Yes, must predate SYMBOL_SET_NAMES> I have no objection. -- Daniel Jacobowitz CodeSourcery