From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8F8B63858C31 for ; Wed, 10 May 2023 08:37:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F8B63858C31 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683707853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=z/YkmW8vsqcPpOe399po0FA9rls6qzs0EYeiWLuT0zM=; b=HZkYWApqr6+AKGDtByT87nmSl8hEtNLOQ1V+306xI7Mm83gwM89pCRs1lCT0pRl7FlwD5x APkYgAaYNd0kKR5heNkY0fazabwFogAD7C2XkKxtru6jVx/CmTrmVSmAi+SD55RQcv8TKE g5i477HVzTZh8pje1askB8mgKY2d6BY= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-222-El7BPWSGNuyTPAouNuwM1Q-1; Wed, 10 May 2023 04:37:29 -0400 X-MC-Unique: El7BPWSGNuyTPAouNuwM1Q-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2ac8f532751so24754091fa.2 for ; Wed, 10 May 2023 01:37:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683707847; x=1686299847; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=z/YkmW8vsqcPpOe399po0FA9rls6qzs0EYeiWLuT0zM=; b=aiHjBMqyGomeb8Bwp5c/XEq/z6C3EFwwz+oQfUUeWGTGYusnRb4/eQO66pIfy/rsZ6 XSE9+9ZuakAn9Bp+AigBElaHoMOEX45FPH/azSTDzbTY1EYSKtFDH9SnsP3lFBNXiplX Udi5RVdgcICirzEOBagi4ekGMGAaO5nZcqR3+8XfNrzmvPdR+j5CHTucv6oSuj3VzjYE Oluk+jgrV6t31e3YmoHORdtKOgnXs7/H8HyaY5kcqupBI2Y/oc+Y2WlcGsiY7zrR+aSl YbYi6G7bPlhkrUCvYTA6WsBs/uThbtEaWxXOIqcFqkdldE9gbCozShmEQarehi6vftjI AjCA== X-Gm-Message-State: AC+VfDxN/U5Db7dpuEAJVHySuSqWCvVnaauax6CX0xTZoSATu+Q2S0Dc yh5wB8LPYDxF2D2Vd9MqtPiPpjEpUvR5tL/zuiJ6n3hvnhoBxXBrBRrPaOvxJePS/1XIkYwKUK/ sgC2m1+eX8ATEw2ZRxtv6aUKGq20yPX0QuQ== X-Received: by 2002:a2e:984f:0:b0:2a8:c45f:9fd8 with SMTP id e15-20020a2e984f000000b002a8c45f9fd8mr1699850ljj.44.1683707847755; Wed, 10 May 2023 01:37:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5kFEElw6XNABwWt6Vk3Sr+dUqKZEnbCwRvaVvhXj5JRlriP+ehurJKvWbqyaVpsYiH28uzmzo7Iibwa4565jE= X-Received: by 2002:a2e:984f:0:b0:2a8:c45f:9fd8 with SMTP id e15-20020a2e984f000000b002a8c45f9fd8mr1699846ljj.44.1683707847462; Wed, 10 May 2023 01:37:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 10 May 2023 09:37:16 +0100 Message-ID: Subject: Re: [PATCH] _Hashtable implementation cleanup To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: "libstdc++" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="00000000000027658e05fb52c871" X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000027658e05fb52c871 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 10 May 2023 at 05:59, Fran=C3=A7ois Dumont via Libstdc++ < libstdc++@gcc.gnu.org> wrote: > Hi > > Rather than providing a series of patches for _Hashtable I prefer to > submit them one by one. It will maximize the chances to have some of > them in gcc 14. > > I'm starting with this simple patch to do some cleanup in the current > implementation to ease compiler optimizations by making some methods > implicitly inline and avoiding the iterator abstraction when useless. > > It is also replacing some faulty usages of __node_type* with __node_ptr. > It should simplify the patch to make use of allocator custom pointer I > would like to reactivate. > > libstdc++: [_Hashtable] Implement several small methods implicitly inline > > Make implementation of 3 simple _Hashtable methods implicitly inline. > > Avoid usage of const_iterator abstraction within _Hashtable implementatio= n. > > Replace several usages of __node_type* with expected __node_ptr. > > libstdc++-v3/ChangeLog: > > * include/bits/hashtable_policy.h > (_NodeBuilder<>::_S_build): Use __node_ptr. > (_ReuseOrAllocNode<>): Use __node_ptr in place of > __node_type*. > (_AllocNode<>): Likewise. > (_Equality<>::_M_equal): Remove const_iterator usages. Only > preserved > to call std::is_permutation in the non-unique key > implementation. > * include/bits/hashtable.h > (_Hashtable<>::_M_update_begin()): Capture > _M_begin() once. > (_Hashtable<>::_M_bucket_begin(size_type)): Implement > implicitly inline. > (_Hashtable<>::_M_insert_bucket_begin): Likewise. > (_Hashtable<>::_M_remove_bucket_begin): Likewise. > (_Hashtable<>::_M_compute_hash_code): Use __node_ptr rather > than > const_iterator. > (_Hashtable<>::find): Likewise. > (_Hashtable<>::_M_emplace): Likewise. > (_Hashtable<>::_M_insert_unique): Likewise. > > Ok to commit ? > OK, thanks --00000000000027658e05fb52c871--