From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29680 invoked by alias); 9 Jul 2012 19:49:22 -0000 Received: (qmail 29559 invoked by uid 22791); 9 Jul 2012 19:49:20 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vb0-f41.google.com (HELO mail-vb0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Jul 2012 19:49:06 +0000 Received: by vbkv13 with SMTP id v13so9033325vbk.0 for ; Mon, 09 Jul 2012 12:49:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=h2DQVOBI9+2u4FOR2WVAIrvVrWP+exR0OhhZ7+RmWuA=; b=NqYjQ1VYEPbL2XeGKUqQaYP67/yIeu8PpNTBprXZ2SHYvHCQGu5eL9Jif5VR5CdG/v MJCnAgr94d8XXTZCRfau3xRIrZNJwpyVfKfPY8uHFJWrnumZh97OtWrWqtFPYUJxsw1Y tNom9ehz2qaeJE9+xxCLKRLqk+d3B7Kdzg+IH2/qcOZ79cf0kv9+k6L8rYkZjzf5/ty/ IpPclCK1414ULqypaweOX5ehEE+/jHSLrYuNBg7HC0NsXxSvZPmvQJBWYnlE58kU0ps0 6TvhdJEy5p+DfKNIfshzbNGuShFNzL0po+KAwAHAoc919RvEyty4e6nI/TLBPKsXJI6C +1yw== Received: by 10.52.21.177 with SMTP id w17mr16440021vde.98.1341863345848; Mon, 09 Jul 2012 12:49:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.21.177 with SMTP id w17mr16440014vde.98.1341863345569; Mon, 09 Jul 2012 12:49:05 -0700 (PDT) Received: by 10.52.34.45 with HTTP; Mon, 9 Jul 2012 12:49:05 -0700 (PDT) In-Reply-To: References: <20120709181015.2FCA41E13A1@ruffy2.mtv.corp.google.com> Date: Mon, 09 Jul 2012 19:49:00 -0000 Message-ID: Subject: Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb. From: Doug Evans To: Steven Bosscher Cc: gcc-patches@gcc.gnu.org, gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQmrI89Vs+NbSmlkBzPDdN525H8jTgeRUSvPEYUWSwzHlsjM7Z0BKDjj3rYIEuEsdh20EXRc3VegiVvku8Q+u4US+MWG0G9FRemKJ4r47k8KJ/2SODoRQwFr69izSMj7qtPNC+c5AF4EyqleyzIZXcGyXDFsrPbLdyCmy4n3jV5waCzgYS8C8MkAe+871eDgjOK1KpMf 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: 2012-07/txt/msg00115.txt.bz2 [- gdb, + gdb-patches] On Mon, Jul 9, 2012 at 11:51 AM, Steven Bosscher wrote: > On Mon, Jul 9, 2012 at 8:10 PM, Doug Evans wrote: >> Hi. >> >> filename_seen in gdb does a linear search, this patch changes it >> to use a hash table. >> >> Ok to check in? > > Why not just use htab_hash_string? The file name canonicalization can > be put in gdb itself. > > Ciao! > Steven [blech, my first reply got turned into rich html] Hi. Given that filename_cmp.c lives in libiberty, putting related functions together makes it easier to maintain them. If you're suggesting writing a function that takes a file name and returns a canonicalized name that will then work with htab_hash_string, that's more expensive and I don't see the benefit.