From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12225 invoked by alias); 27 Mar 2013 14:39:22 -0000 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 Received: (qmail 12113 invoked by uid 89); 27 Mar 2013 14:39:11 -0000 X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from na3sys009aog126.obsmtp.com (HELO na3sys009aog126.obsmtp.com) (74.125.149.155) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 27 Mar 2013 14:39:08 +0000 Received: from mx20.qnx.com ([72.1.200.103]) (using TLSv1) by na3sys009aob126.postini.com ([74.125.148.12]) with SMTP ID DSNKUVMEamsUHAGBvEFaRwdfITO1XRG+TOHx@postini.com; Wed, 27 Mar 2013 07:39:08 PDT Received: by mx20.qnx.com (Postfix, from userid 500) id 17A4620E31; Wed, 27 Mar 2013 10:38:30 -0400 (EDT) Received: from exhts.ott.qnx.com (exch2 [10.222.2.136]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx20.qnx.com (Postfix) with ESMTPS id C7FAC20A7D; Wed, 27 Mar 2013 10:38:29 -0400 (EDT) Received: from [10.222.96.215] (10.222.2.5) by EXCH2.ott.qnx.com (10.222.2.136) with Microsoft SMTP Server (TLS) id 14.2.318.4; Wed, 27 Mar 2013 10:38:29 -0400 Message-ID: <51530465.30503@qnx.com> Date: Wed, 27 Mar 2013 17:54:00 -0000 From: Aleksandar Ristovski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: Jan Kratochvil CC: "gdb-patches@sourceware.org" Subject: Re: [patch 6/6] gdbserver build-id attribute generator References: <51278984.3070208@qnx.com> <20130310210843.GG21130@host2.jankratochvil.net> <514C56D4.1060906@qnx.com> <20130326204157.GC12291@host2.jankratochvil.net> In-Reply-To: <20130326204157.GC12291@host2.jankratochvil.net> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-03/txt/msg01020.txt.bz2 On 13-03-26 04:41 PM, Jan Kratochvil wrote: >> >+ >> >+ if (build_id_list_p) >> >+ qsort (VEC_address (build_id_list_s, data.list), >> >+ VEC_length (build_id_list_s, data.list), >> >+ sizeof (build_id_list_s), compare_build_id_list); > It is always already sorted by Linux kernel, rather a for cycle to verify it > really is sorted. > > Can we guarantee this is always the case? Even if it is, qsort would do similar to what a loop would (i.e. no moves would take place). I'd leave it with qsort unless you feel strongly about it.