public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][Hashtable 0/6] Code review
Date: Wed, 29 Jul 2020 11:35:40 +0200	[thread overview]
Message-ID: <76cc90a6-2bb6-e882-09df-9483a5eecce5@gmail.com> (raw)
In-Reply-To: <20200717101140.GA2827962@redhat.com>

On 17/07/20 12:11 pm, Jonathan Wakely wrote:
> N.B. the 0/6 entry of a patch series is supposed to be a cover letter
> describing the changes in the series, not one of the patches.
>
> If you have patches 0/6, 1/6, 2/6 ... 6/6 then you actually have seven
> patches, not six!
>
> Anyway ...
>
> On 19/12/19 20:17 +0100, François Dumont wrote:
>> diff --git a/libstdc++-v3/include/bits/hashtable_policy.h 
>> b/libstdc++-v3/include/bits/hashtable_policy.h
>> index f5809c7443a..b9320506bb2 100644
>> --- a/libstdc++-v3/include/bits/hashtable_policy.h
>> +++ b/libstdc++-v3/include/bits/hashtable_policy.h
>> @@ -172,6 +172,14 @@ namespace __detail
>>
>>   // Auxiliary types used for all instantiations of _Hashtable nodes
>>   // and iterators.
>> +  using __unique_keys_t = true_type;
>> +  using __multi_keys_t = false_type;
>> +
>> +  using __constant_iterators_t = true_type;
>> +  using __mutable_iterators_t = false_type;
>> +
>> +  using __hash_cached_t = true_type;
>> +  using __hash_not_cached_t = false_type;
>
> This is an ABI change, and the benefit doesn't seem large enough to
> justify it. It will result in code size increases for anything that
> links objects compiled before and after the change.
>
> If we wanted to do this, I think it would be better to use enums, so:
>
> enum _Unique_keys { __unique_keys, __multi_keys };
>
> Otherwise you can use __hash_cached_t where __unique_keys_t is meant
> to be used, so all you've done is introduce more names for the same
> things.
>
> If you want to replace the 'true' and 'false' literals with something
> more descriptive, can't you just use constants?
>
> constexpr bool __hash_cached = true;
> constexpr bool __hash_not_cached = false;
>
> Or just use comments:
>
>     struct _Local_iterator_base<_Key, _Value, _ExtractKey,
>                 _H1, _H2, _Hash, /*cached=*/ false>
>
>
Ok, I'll review this patch with this simpler approach.

I even started to add comments in the patch you already approved.


      reply	other threads:[~2020-07-29  9:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-17 20:42 François Dumont
2019-12-09 21:16 ` François Dumont
2019-12-19 19:17   ` François Dumont
2020-07-17 10:11     ` Jonathan Wakely
2020-07-29  9:35       ` François Dumont [this message]

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=76cc90a6-2bb6-e882-09df-9483a5eecce5@gmail.com \
    --to=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).