From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26407 invoked by alias); 20 Nov 2018 04:03:52 -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 26393 invoked by uid 89); 20 Nov 2018 04:03:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Nov 2018 04:03:50 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id wAK43iXI021105 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 19 Nov 2018 23:03:48 -0500 Received: by simark.ca (Postfix, from userid 112) id 38D831E992; Mon, 19 Nov 2018 23:03:44 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 6A2591E003; Mon, 19 Nov 2018 23:03:43 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 20 Nov 2018 04:03:00 -0000 From: Simon Marchi To: David Blaikie Cc: Simon Marchi , gdb-patches Subject: Re: [PATCH] Use std::forward_list for displaced_step_inferior_states In-Reply-To: References: <20181112185945.24599-1-simon.marchi@ericsson.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00312.txt.bz2 On 2018-11-19 18:21, David Blaikie wrote: > Why forward list of pointers rather than forward list of values? > Forward list of pointers would make two allocations per node, rather > than one, I think? You are right, there's no good reason (except that maybe it was a smaller step). > Ah, I'd replied on the other thread about this with a patch, but my > email got bounced due to rich text (Google Inbox). > > I've attached my patch for this - though it uses list instead of > forward_list - good catch on that! Actually, I would use an std::vector. There's a single object per inferior, so that list is likely to be very small. A vector should be faster for pretty much every situation. From what I can see, it doesn't matter if objects are moved (we don't save a pointer to them anywhere). Does that sound good to you (I can take care of writing the patch)? Simon