From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8461 invoked by alias); 21 Jul 2009 17:09:25 -0000 Received: (qmail 8452 invoked by uid 22791); 21 Jul 2009 17:09:25 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Jul 2009 17:09:15 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6LH9CtV008475; Tue, 21 Jul 2009 13:09:12 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6LH9BVA001799; Tue, 21 Jul 2009 13:09:12 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6LH9AQA019792; Tue, 21 Jul 2009 13:09:11 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id DEC813780F2; Tue, 21 Jul 2009 10:06:40 -0600 (MDT) To: Paul Pluzhnikov Cc: gdb-patches ml Subject: Re: [patch] Speed up find_pc_section References: <8ac60eac0907161724v40e5bd8bg7877d8901b8d7b6e@mail.gmail.com> <8ac60eac0907170927x6314e81djc7f37e8a383dff2b@mail.gmail.com> From: Tom Tromey Reply-To: Tom Tromey Date: Tue, 21 Jul 2009 17:57:00 -0000 In-Reply-To: <8ac60eac0907170927x6314e81djc7f37e8a383dff2b@mail.gmail.com> (Paul Pluzhnikov's message of "Fri\, 17 Jul 2009 09\:27\:11 -0700") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-07/txt/msg00514.txt.bz2 >>>>> "Paul" == Paul Pluzhnikov writes: Paul> Hmm, this one is trickier (I don't want to make objfiles_updated_p Paul> global). Yeah, good call. Paul> I moved the 'objfiles_updated_p += 1' from free_objfile() into Paul> clear_objfile_data() -- that's called from reread_symbols() as well. I don't like this so much. clear_objfile_data is a clear, single-purpose function. I'm reluctant to add unrelated code to it. Perhaps a new function would be better. Or, maybe there is a way to do this by registering some observers. Paul> 2009-07-17 Paul Pluzhnikov Paul> * objfiles.c (objfiles_updated_p): New variable. Paul> (qsort_cmp, bsearch_cmp, update_section_map): New functions. Paul> (find_pc_section): Use bsearch. This should mention the modified functions: add_to_objfile_sections, objfile_relocate, and clear_objfile_data. + objfiles_updated_p += 1; /* Rebuild section map next time we need it. */ Since this is just a boolean flag I think a plain assignment is clearer. An increment leads me to wonder what the count means. Tom