This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/9] Introduce and use language_set
>>>>> "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