From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50699 invoked by alias); 29 May 2015 13:34:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 50633 invoked by uid 89); 29 May 2015 13:34:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 29 May 2015 13:34:01 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 00DD6AC66; Fri, 29 May 2015 13:33:58 +0000 (UTC) Message-ID: <55686AC5.6050708@suse.cz> Date: Fri, 29 May 2015 13:34:00 -0000 From: =?windows-1252?Q?Martin_Li=9Aka?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Jeff Law , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 10/35] Change use to type-based pool allocator in cfg.c. References: <83d59ba92a3c4b3ba831ebc2fce325f0416848d0.1432735040.git.mliska@suse.cz> <55660592.3080402@redhat.com> In-Reply-To: <55660592.3080402@redhat.com> Content-Type: multipart/mixed; boundary="------------000407090107030009020603" X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg02763.txt.bz2 This is a multi-part message in MIME format. --------------000407090107030009020603 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-length: 386 On 05/27/2015 07:57 PM, Jeff Law wrote: > On 05/27/2015 07:56 AM, mliska wrote: >> gcc/ChangeLog: >> >> 2015-04-30 Martin Liska >> >> * cfg.c (initialize_original_copy_tables):Use new type-based pool allocator. >> (free_original_copy_tables) Likewise. >> (copy_original_table_clear) Likewise. >> (copy_original_table_set) Likewise. > OK. > jeff > v2 --------------000407090107030009020603 Content-Type: text/x-patch; name="0009-Change-use-to-type-based-pool-allocator-in-cfg.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0009-Change-use-to-type-based-pool-allocator-in-cfg.c.patch" Content-length: 2378 >From 6facfc84e89ec3a887e7db342493e7656fb29dc4 Mon Sep 17 00:00:00 2001 From: mliska Date: Wed, 27 May 2015 15:56:47 +0200 Subject: [PATCH 09/32] Change use to type-based pool allocator in cfg.c. gcc/ChangeLog: 2015-04-30 Martin Liska * cfg.c (initialize_original_copy_tables):Use new type-based pool allocator. (free_original_copy_tables) Likewise. (copy_original_table_clear) Likewise. (copy_original_table_set) Likewise. --- gcc/cfg.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/gcc/cfg.c b/gcc/cfg.c index cdcc01c..ddfecdc 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -1066,18 +1066,16 @@ static hash_table *bb_copy; /* And between loops and copies. */ static hash_table *loop_copy; -static alloc_pool original_copy_bb_pool; - +static pool_allocator *original_copy_bb_pool; /* Initialize the data structures to maintain mapping between blocks and its copies. */ void initialize_original_copy_tables (void) { - gcc_assert (!original_copy_bb_pool); - original_copy_bb_pool - = create_alloc_pool ("original_copy", - sizeof (struct htab_bb_copy_original_entry), 10); + + original_copy_bb_pool = new pool_allocator + ("original_copy", 10); bb_original = new hash_table (10); bb_copy = new hash_table (10); loop_copy = new hash_table (10); @@ -1095,7 +1093,7 @@ free_original_copy_tables (void) bb_copy = NULL; delete loop_copy; loop_copy = NULL; - free_alloc_pool (original_copy_bb_pool); + delete original_copy_bb_pool; original_copy_bb_pool = NULL; } @@ -1117,7 +1115,7 @@ copy_original_table_clear (hash_table *tab, unsigned obj) elt = *slot; tab->clear_slot (slot); - pool_free (original_copy_bb_pool, elt); + original_copy_bb_pool->remove (elt); } /* Sets the value associated with OBJ in table TAB to VAL. @@ -1137,8 +1135,7 @@ copy_original_table_set (hash_table *tab, slot = tab->find_slot (&key, INSERT); if (!*slot) { - *slot = (struct htab_bb_copy_original_entry *) - pool_alloc (original_copy_bb_pool); + *slot = original_copy_bb_pool->allocate (); (*slot)->index1 = obj; } (*slot)->index2 = val; -- 2.1.4 --------------000407090107030009020603--