From: Simon Marchi <simon.marchi@polymtl.ca>
To: David Blaikie <dblaikie@gmail.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>,
gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Use std::forward_list for displaced_step_inferior_states
Date: Tue, 20 Nov 2018 04:03:00 -0000 [thread overview]
Message-ID: <dac253be972488dc45c3a9e2d18e5fbf@polymtl.ca> (raw)
In-Reply-To: <CAENS6EufMHiop5hJ8+wavYLZVmJyE6vQoApwhwG01P4QXLcYKg@mail.gmail.com>
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
next prev parent reply other threads:[~2018-11-20 4:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20181112185945.24599-1-simon.marchi@ericsson.com>
2018-11-18 18:56 ` Kevin Buettner
2018-11-19 16:58 ` Simon Marchi
2018-11-19 23:21 ` David Blaikie
2018-11-20 4:03 ` Simon Marchi [this message]
2018-11-21 17:27 ` David Blaikie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dac253be972488dc45c3a9e2d18e5fbf@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=dblaikie@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox