Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: John Baldwin <jhb@FreeBSD.org>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH 2/9] Introduce and use language_set
Date: Fri, 08 Mar 2019 22:21:00 -0000	[thread overview]
Message-ID: <87ftrxdn3r.fsf@tromey.com> (raw)
In-Reply-To: <6387c828-db23-3e49-fb76-699f5fc9e82b@FreeBSD.org> (John	Baldwin's message of "Thu, 7 Mar 2019 15:04:38 -0800")

>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:

John> On 3/7/19 12:57 PM, Tom Tromey wrote:
>> I noticed that objfile_per_bfd_storage::demangled_hash_languages is a
>> std::vector, which seemed quite large for something that,
>> fundamentally, can be represented as a bit-set.  This patch
>> reimplements it as a bit-set.

John> Hmm, did you consider using std::bitset<nr_languages> for langauge_set?  You'd
John> still have to write your own iterator class, so it wouldn't save much in terms
John> of lines of code.  It just seems a bit odd to write a bitset class from scratch?

I didn't really consider it.

I looked now and on my machine, std::bitset<nr_languages> is 8 bytes,
whereas langauge_set is just 4.  So, with the custom implementation, I
could pack it into a hole in objfile_per_bfd_storage.

That said, due to the minsym arrays, objfile_per_bfd_storage is
enormous, so saving 4 bytes probably isn't important.  So, I'll redo
this.

Tom


  reply	other threads:[~2019-03-08 22:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 21:11 [PATCH 0/9] Minor minimal symbol improvements Tom Tromey
2019-03-07 20:57 ` [PATCH 3/9] Remove some unneeded initializations in minimal_symbol_reader Tom Tromey
2019-03-07 20:57 ` [PATCH 2/9] Introduce and use language_set Tom Tromey
2019-03-07 23:05   ` John Baldwin
2019-03-08 22:21     ` Tom Tromey [this message]
2019-03-08 22:43     ` Tom Tromey
2019-03-08 23:44       ` John Baldwin
2019-03-07 20:57 ` [PATCH 4/9] Remove minsym termination Tom Tromey
2019-03-07 20:57 ` [PATCH 8/9] Use memcpy in minimal_symbol_reader::install Tom Tromey
2019-03-07 20:57 ` [PATCH 6/9] Use htab_up for demangled hash Tom Tromey
2019-03-07 20:57 ` [PATCH 5/9] Simplify per-BFD storage management Tom Tromey
2019-03-07 20:57 ` [PATCH 9/9] Change minimal_symbol inheritance Tom Tromey
2019-03-07 20:57 ` [PATCH 7/9] Allocate minimal symbols with malloc Tom Tromey
2019-03-07 20:57 ` [PATCH 1/9] Slightly simplify minsym creation Tom Tromey
2019-03-15 22:04 ` [PATCH 0/9] Minor minimal symbol improvements Tom Tromey

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=87ftrxdn3r.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.org \
    /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