From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27288 invoked by alias); 21 Nov 2018 17:27:59 -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 27273 invoked by uid 89); 21 Nov 2018 17:27:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=sure!, Hx-languages-length:1091, that!, H*f:sk:dac253b X-HELO: mail-it1-f196.google.com Received: from mail-it1-f196.google.com (HELO mail-it1-f196.google.com) (209.85.166.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Nov 2018 17:27:57 +0000 Received: by mail-it1-f196.google.com with SMTP id h193so10001181ita.5 for ; Wed, 21 Nov 2018 09:27:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5URPcIQ9aZWgCoEgb4Crxu+OPyPWlnhQTfuqf2sG0gU=; b=kNurVERyBBBsWnS20Bdq+UXu7ft2iPCoscWgDa7X1OpClqYHc+WGhQlhZeoUuvJgeI jn95KGRFPltZzj34Fm22Zno79hA5vwh5Ev5p7Md1N2lXSWAfEkhg+58pa5ee2n+mTcI0 rerMbNRu/naYGu4uJXc2Gtac0uV7guFN8K+ZX0ZN5A8HP+2Si6+rtO3Btfjl8hFtnn/I BqzJXch+cTKamATvNVABABhVHXkva2II6YsqY709MUwXsfmiMBjVuL55ncZy6s1QGWlG S4S1Mwf9onClz1PlKlXPmnqT7ee8J6zKi0lY/ngKSHydAUvn9BjAFrX7CqfLgxjM8v90 kmHQ== MIME-Version: 1.0 References: <20181112185945.24599-1-simon.marchi@ericsson.com> In-Reply-To: From: David Blaikie Date: Wed, 21 Nov 2018 17:27:00 -0000 Message-ID: Subject: Re: [PATCH] Use std::forward_list for displaced_step_inferior_states To: Simon Marchi Cc: Simon Marchi , gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00358.txt.bz2 On Mon, Nov 19, 2018 at 8:03 PM Simon Marchi wrote: > > 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)? Yeah, for sure! Thanks! - Dave > > Simon