From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 824 invoked by alias); 16 Aug 2010 19:50:48 -0000 Received: (qmail 816 invoked by uid 22791); 16 Aug 2010 19:50:47 -0000 X-SWARE-Spam-Status: No, hits=-6.1 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; Mon, 16 Aug 2010 19:50:41 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7GJodix024033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 Aug 2010 15:50:39 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7GJocSd018061 for ; Mon, 16 Aug 2010 15:50:39 -0400 Received: from [10.15.16.129] (dhcp-10-15-16-129.yyz.redhat.com [10.15.16.129]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o7GJocgj011656 for ; Mon, 16 Aug 2010 15:50:38 -0400 Message-ID: <4C699679.6090209@redhat.com> Date: Mon, 16 Aug 2010 19:50:00 -0000 From: sami wagiaalla User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Thunderbird/3.1.1 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [RFC] Use custom hash function with bcache References: <4C6946E1.6000709@redhat.com> <20100816191348.GA16221@caradoc.them.org> In-Reply-To: <20100816191348.GA16221@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2010-08/txt/msg00240.txt.bz2 On 08/16/2010 03:13 PM, Daniel Jacobowitz wrote: > On Mon, Aug 16, 2010 at 10:10:41AM -0400, sami wagiaalla wrote: >> This patch enables the use of custom hash and comparison functions >> when adding elements to a bcache. The patch also introduces hash and >> comparison functions which take into consideration only the relevant >> properties of the psymbol. > > This patch makes me nervous because it's violating the invariants of > the bcache. Any time you get a psymbol from the bcache, it is going > to have other fields that were not hashed somewhat random. What are > those ignored fields, and why do they not matter? How about > lifetimes, are they as long-lived as the bcache? > I only took into consideration the values which are set by add_psymbol_to_bcache. The assumption is that these are the only values that will make a difference since they are the only values available when calculating the hash. > You compare name, value, language, domain, and class. The mangled > name is ignored; this assumes that there is only ever one mangled name > per demangled name, with no documentation of why that's safe to > assume. Hmm, the demangled name can be added if this is not a correct assumption. I just wanted to avoid the redundant check, and language_specific part of the symbol. Section is ignored; if there are two definitions of a symbol > with the same name in different sections but the same value otherwise, > we'll never find out. That could break overlays. > Section is set to 0 by add_psymbol_to_bcache