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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 536753987023 for ; Wed, 11 Nov 2020 03:55:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 536753987023 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-OgXvCgt-PbuFpEsY5vv3-A-1; Tue, 10 Nov 2020 22:55:42 -0500 X-MC-Unique: OgXvCgt-PbuFpEsY5vv3-A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1994B1007B09; Wed, 11 Nov 2020 03:55:41 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-181.phx2.redhat.com [10.3.114.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id E04CC5B4A0; Wed, 11 Nov 2020 03:55:40 +0000 (UTC) Subject: Re: [PATCH 2/3] Refactor section name ref counting To: Strager Neds , gcc-patches@gcc.gnu.org References: From: Jeff Law Message-ID: <00b71e98-eb2a-9030-33c7-7eeb07e171ac@redhat.com> Date: Tue, 10 Nov 2020 20:55:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 03:55:45 -0000 On 11/12/19 11:28 PM, Strager Neds wrote: > symtab_node::set_section_for_node manages the reference count of > section_hash_entry objects. I plan to add another function which needs > to manage the reference count of these objects. To avoid duplicating > code, factor the existing logic into reusable functions. > > This patch should not change behavior. > > Testing: Bootstrap on x86_64-linux-gnu with --disable-multilib > --enable-checking=release --enable-languages=c,c++. Observe no change in > test results. > > 2019-11-12 Matthew Glazar > > * gcc/symtab.c (symtab_node::set_section_for_node): Extract reference > counting logic into ... > (retain_section_hash_entry): ... here (new function) and ... > (release_section_hash_entry): ... here (new function). I fixed some minor formatting problems, added function comments to the factored-out code and re-tested this patch.  I'm pushing it to the trunk momentarily. jeff